Old 06-28-2016, 08:30 AM   #1
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,652
Default JSFX: Decimal scientific notation

IMHO it would be nice if you could use decimal scientific notation in JSFX to specify constants, e.g.:

Code:
x = 1.2e-3; // 0.0012
Of course I can work around this by doing something like:

Code:
function e(n) ( 10^n );

x = 1.2*e(-3);
Or slightly less readable, but likely more efficient:

Code:
x = 1.2*10^-3;
Tale is online now   Reply With Quote
Old 06-29-2016, 02:06 PM   #2
Smashed Transistors
Human being with feelings
 
Smashed Transistors's Avatar
 
Join Date: Jul 2014
Location: Là bas les huîtres (FR)
Posts: 424
Default

I totally agree !!
It is an almost universal standard notation.

sometimes i generate part of my jsfx code with java programs, for example to
generate tables much like:
Code:
t[0]=0.10231;t[1]=0.0123;
and i have to be careful with the 1.23e-2 that may be generated by the java code...
__________________
JSFX plugins and synths. See you here and there: SoundCloud, Youtube, Google Play...
Smashed Transistors is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:45 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.