Skip to content

Commit b5e8d43

Browse files
committed
Actually fix Math.sin properly this time
1 parent 4b7cc5f commit b5e8d43

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
If debugging via bluetooth and we disconnect, quit debugging (locks Bluetooth otherwise)
1414
Remove Line Number handling code (most code will be run out of Storage now, where we know the line number)
1515
Debugger now uses jslPrintPosition to print file+line+col, is aware of Modules.addCached that IDE adds and discounts it
16-
Fix Math.sin on negative numbers on extremely constrained builds (Bangle.js 1/Microbit) where we have to use a very small sin implementation
16+
Fix Math.sin on negative numbers on extremely constrained builds (Bangle.js 1/Microbit) where we have to use a very small sin implementation (#2637)
1717
Bangle.js2: Calling Bangle.getPressure() while a conversion is in progress now returns the same promise (so it will complete as soon as pressure data is ready) rather than erroring
1818
Bangle.js2: Fix 2v22 regression where `E.showMenu({test:{}})` would display 'test:undefined'
1919
Fat FS: Added `r+` file open mode (and allow w+ to read)

src/jswrap_math.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ double jswrap_math_sin(double x) {
4949
* So about 3k, just for sin.
5050
* */
5151
// exploit symmetry - we're only accurate when x is small
52-
if (x<0) x=-x;
52+
if (x<0) x=PI-x;
5353
int xi = (int)(x/PI);
5454
x -= xi*PI;
5555
if (x>PI/2) x=PI-x;

0 commit comments

Comments
 (0)