Giter Club home page Giter Club logo

webcalculatordemo's Introduction

WebCalculatorDemo

This is my first JS project, is a simple calculator, the latter will be a variety of improvements, such as beautify the appearance, increase the function, etc.

项目特点

  • 使用的是原生 JavaScript 、 CSS 、 HTML 语言,并没有使用任何框架
  • 使用了工厂模式的设计模式
  • xxx-abandon.js是最早的计算器业务逻辑代码,因扩展性、复用性、可维护性较低,后重构代码写了OperationTypeFactory.jsSimpleCalculatorIndex.js这份新的业务代码,改善了扩展性,复用性和可维护性。其中OperationTypeFactory.js是运算类型对象代码,以后如果想增加运算类型,可在此增加对应运算类型对象。SimpleCalculatorIndex.js主要有一个Main类对象,其提供了与界面交互的业务代码。
  • 后期会不定期逐步增加功能或美化外观

版本更新

version 1.0

1.0版本效果

  1. 提供了开方、三角函数、乘除加减运算、求幂运算
  2. 只能进行正整数的运算

version 2.0

乘法运算

支持小数点和负数运算

  1. 支持小数点、负数运算
  2. 提供圆周率数值
  3. 提供一键清除运算过程和退位
  4. 支持显示运算表达式

TO-DO

  • 增加科学计算界面
  • 增加多表达式计算
  • 解决浮点数不精确的问题
  • 运算结果最多显示10位有效数学
  • 运算符号显示修正
  • 实现计算结果自动保存功能

在线预览

WebCalculatorDemo

我的个人博客

刘志宇的新天地

webcalculatordemo's People

Contributors

summerliu95 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.