55 Commits

Author SHA1 Message Date
Ramesh Vijayaraghavan
c7f4c53483
Support for Percentage Operation (#2304)
* Support for Percentage Operation

* Fixed Style issue

* Added Test case to check for modulo followed by pi

* Support for % addition and % subtraction

* Fixed Documentation comment

* Support - Should not calculate mod for negative divisor

* Updated Docs

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2021-09-22 11:45:37 +02:00
Colin Holzman
90e15c6d95
Support for parsing non decimal numbers with radix point (#2122)
* Basic untested support for parsing non decimal numbers with radix point.

* Added some documentation for function parseNonDecimalWithRadix.

* Renamed variable in BigNumber constructor.

Not related to current feature branch but is a good change.

* Improved some variable and function names in number.js and fixed an error when parsing octal numbers with radix point.

* Added some tests and fixed linter issues.

* Added some documentation on new syntax.

* Added more tests.

* Added more tests for edge cases.
2021-03-10 09:01:08 +01:00
Colin Holzman
d12f3a5fac
Word size suffix and BigNumber support for bin oct hex literals (#1996)
* added support for word size suffix in getToken

* start modifying number(string) to support word size suffix for signed integers

* word size suffixes for Number

* initial support for BigNumber

* fix linter issues

* remove unused variable

* start extending bitwise operators for Number for values greater than 32 bits

* Revert "start extending bitwise operators for Number for values greater than 32 bits"

This reverts commit 6fac1a7b10665a221ab5de521c08fa9fcf959eb1.

* add a test for 53 bit literal

* added an optional second argument to bin, oct, and hex to allow formatting signed numbers with custom word size

* removed size checks

* Attempted to extend bin, oct, hex format functions to work with BigNumber, but not working fully.

Apparently Decimal.js toString method doesn't take a base parameter like js number does. I guess I have to do the formatting myself.

* Added n2base function to do formatting for BigNumber.

* Added check for zero in n2base.

* Removed old failing tests.

* Added some tests (failing).

* Extended 'format' function with 'base' and 'wordSize' options and changed 'bin', 'oct', and 'hex' to use 'format' function.

* Fixed lint issues.

* Fixed issues related to the merge.

* Corrected a test.

* Fixed bignumber formatter.

* Added tests for math.format with 'base' and 'wordSize' options.

* Fixed lint issue.

* Changed 'base' option to 'bin', 'oct', and 'hex' values for 'notation' option of 'format' function.

* Added word size suffix to the output of format, bin, oct, and hex.

* Updated documentation.
2021-01-06 09:46:58 +01:00
Colin Holzman
f5d843bbc6
Binary, octal, and hexadecimal literals and formatting (#1968)
* allow binary, octal, and hex literals as in JS (0b, 0o, 0x)

* add tests

* fix lint issues

* add notation for binary, octal, and hex in formatNumber

* remove the extra format notations

* add bin, oct, and hex functions for formatting

* move bin, oct, and hex from base.js to their own files, fixed built test error about documentation

* parse and format treat values as 32 bit signed 2s complement integers

* add section in syntax documentation

* typo

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2020-09-26 17:45:10 +02:00
josdejong
e9cf247c7d Fix #1902: typo in an example in the documentation 2020-07-03 08:29:15 +02:00
jos
078f1dd69f Renamed methods .eval to .evaluate, updated all docs and examples accordingly 2019-01-16 10:11:32 +01:00
Eric Mansfield
d23d8c71a4 Chained conditionals (#1267)
* Minimally working

* Added tests, toString

* Added tests for evaluation

* Minor changes

* Added a line in the docs about chained conditionals

* Documentation, replacing var and let with const
2018-10-04 20:26:39 +02:00
jean-emmanuel
710ed1e58f Add support for single quotes strings 2018-08-04 10:27:10 +02:00
jos
8b5eb89a02 Minor tweaks in the docs 2018-06-16 14:57:28 +02:00
jos
b3b96749bf Refactored var into const/let, and removed a lot of semicolons 2018-06-13 12:21:14 +02:00
jos
cf5c1c1af8 Fixes #1054: renamed eye to identity 2018-06-06 10:52:08 +02:00
Jos de Jong
cdda817d9f
Merge pull request #1036 from ericman314/implicit-multiplication
Implicit multiplication
2018-02-04 11:55:15 +01:00
Eric Mansfield
e0b8640ab4 Added more examples for implicit multiplication 2018-02-03 14:26:04 -07:00
Eric Mansfield
cd5381a64f Minor formatting 2018-02-03 11:39:37 -07:00
Eric Mansfield
3f62bd9ebd Finished docs 2018-02-03 11:32:17 -07:00
Eric Mansfield
260bb8d823 Halfway done with docs 2018-02-03 11:01:10 -07:00
denisx
b5729262af
Fix Bitwise xor sample result 2018-01-12 21:50:45 +03:00
jos
e7766e4468 Replaced examples resulting in round-off errors to prevent confusion (see #910) 2017-08-02 20:02:51 +02:00
jos
469e6bf3cf Fixed #895: added support for the dollar character $ in symbol names 2017-07-10 20:29:30 +02:00
jos
7152142661 Fixed #732: Allow letter-like unicode characters like Ohm \u2126 2016-11-18 19:19:17 +01:00
H.D. Sarson
04732a2456 Edited description of string operations to include setting values in strings 2016-11-08 14:58:43 +00:00
H.D. Sarson
356e2cf096 tidied up example so it is easier to read 2016-11-08 14:40:20 +00:00
Harry Sarson
0428d0cf80 Changed expressions/syntax in docs to represent the actaul result of string opperations. 2016-11-07 20:27:51 +00:00
Harry Sarson
b6a96fa76a Changed ',' to ';' in doc's to fix typo 2016-11-07 19:43:22 +00:00
jos
20a571f38d Fixed #688: Describe allowed variable names in the docs 2016-10-21 16:50:51 +02:00
jos
094274762b Added some docs on creating a typed function in the expression parser (see #665) 2016-05-22 15:40:14 +02:00
jos
1a45d520ba Clarified the docs on string concatenation (see #664) 2016-05-22 14:54:42 +02:00
jos
6f1094a309 Clarified the docs on string concatenation (see #664) 2016-05-22 14:49:57 +02:00
jos
c8d41fc5b4 Restored support for implicit multiplications like (2+3)(4+5) 2016-03-19 20:16:54 +01:00
jos
15aca5e4d0 Changed casing of the values of config options number and matrix to match the actual name of the classes. 2016-03-04 19:41:54 +01:00
jos
e152c9943c Fixed a lot of broken links 2016-03-04 16:56:19 +01:00
jos
d9b9902842 Moved functions.md and classes.md to /reference 2016-03-03 21:16:06 +01:00
jos
2b7c00e481 Updated syntax.md 2016-01-14 21:50:59 +01:00
jos
fad5d8cc07 Merged parseFunctions and parseIndex into parseAccessors. Restricted support for implicit multiplication, execute as accessors instead 2016-01-09 21:11:29 +01:00
jos
99552744f6 Added docs and an example on objects 2016-01-03 19:47:41 +01:00
Tomek Wiszniewski
aef0d74065 Fix typo 2015-09-15 18:12:02 +02:00
Eric Mansfield
377be29eb6 Fix my typos 2015-08-03 23:34:30 -06:00
Eric
f5d166a809 Made an attempt at derived units with simplification
Updated unit tests
Updated examples
Updated docs
2015-08-04 05:26:00 +00:00
jos
a92b978036 Merged develop into v2 2015-06-07 15:57:41 +02:00
jos
be98cf613d Updated docs of add to reflect changed behavior for strings 2015-05-20 19:59:43 +02:00
Devan Patel
f91d8a893d Fixing grammatical issues in Syntax.md 2015-05-15 15:01:31 -04:00
jos
0c1e9deeeb Implemented configuration value {number: 'fraction'}. Added docs and example for fractions. 2015-05-12 14:40:47 +02:00
jos
2f137f5885 Added header "Precedence" 2015-02-24 20:57:45 +01:00
Ole Kröger
4c8dda8824 [3,6,9] for 1*3,2*3,3*3 2015-02-19 15:37:04 +01:00
jos
904f4ed8df Added some docs about converting a unit to a number with the expression parser 2015-01-05 21:07:00 +01:00
jos
7411e02889 Improved a code example 2014-12-29 09:37:23 +01:00
jos
b1c29bc8cd Fixed issues with the pipe character in markdown 2014-12-27 13:05:23 +01:00
jos
8b253f050b Renamed function select to chain 2014-12-25 17:05:29 +01:00
jos
97163135b2 Implemented xor operator ^| in the expression parser 2014-12-25 15:45:54 +01:00
jos
73b67bfc09 Removed logical not operator ! (so now we just have logical operators and, not, or, xor). 2014-12-25 14:21:16 +01:00