Cockos Incorporated Forums JSFX: Imprecise \$phi value
 User Name Remember Me? Password
 Register Track Bugs/Feature Requests Search Today's Posts Mark Forums Read

 Thread Tools Display Modes
 09-06-2018, 02:23 PM #1 Tale Human being with feelings     Join Date: Jul 2008 Location: The Netherlands Posts: 2,975 JSFX: Imprecise \$phi value In JSFX the \$phi constant seems to have "only" 9 decimals, but for it to be precise at 64-bit double floating point it would need 17 decimals. Code: ```desc:what the phi?! @init y1 = \$phi; // 1.61803399 x1 = sqr(y1 * 2 - 1); // Not exactly 5 y2 = (sqrt(5) + 1) / 2; x2 = sqr(y2 * 2 - 1); // 5 y3 = 1.6180339887498948; x3 = sqr(y3 * 2 - 1); // 5 @gfx gfx_x = gfx_y = 8; gfx_a = gfx_r = 1; gfx_g = gfx_b = 0; gfx_printf("%1.16e %1.16e\n", y1, x1); gfx_y += 2; gfx_r = 0; gfx_g = 1; gfx_printf("%1.16e %1.16e\n", y2, x2); gfx_y += 2; gfx_printf("%1.16e %1.16e\n", y3, x3); gfx_y += 2;``` Tested in REAPER 5.9x i386 and x86-64 on macOS 10.13. Not at all important of course, but now that I know: It itches. __________________ Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack

 Thread Tools Display Modes Linear Mode

 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home General Discussion     General Discussion (aka spam trap) REAPER Forums     REAPER General Discussion Forum     newbieland     REAPER Q&A, Tips, Tricks and Howto     Recording Technologies and Techniques     REAPER Compatibility     REAPER Color Themes and Icon Sets     MIDI Hardware, Control Surfaces, and OSC     REAPER Non-English Speaking User Forums         Forum de REAPER en français         Foro de REAPER en Español         Fórum do REAPER em português         Forum di REAPER in italiano         Deutschsprachiges REAPER Userforum         Pyccкоязычный фopyм REAPER     REAPER Bug Reports     REAPER Feature Requests     Dstruct's Casa De Nitpicks     REAPER for Live Use     REAPER for Video Editing/Mangling     REAPER for Ambisonic and 3D positional audio uses     ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum     REAPER for macOS X     REAPER for Linux     REAPER Pre-Release Discussion     REAPER Music/Collaboration Discussion     REAPER lounge NINJAM Discussion     NINJAM User Discussion     NINJAM Developer Discussion Other Software Discussion     WDL users forum     LICEcap Discussion     OSCII-bot forum     Old Cockos Products Forum

All times are GMT -7. The time now is 04:46 PM.

 -- Cockos ---- REAPER 5 ---- Reaper 3 ---- Reaper 2 ---- Reaper 1 Contact Us - Çockos Incorporated - Archive - Top