View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002572SphereServerexecutable - genericpublic23-01-16 15:5711-07-16 21:43
Reporternolok 
Assigned To 
PrioritynormalSeveritytrivialReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002572: FLOATVAL error with ABS and issue with SQRT
Description.show eval ABS(-1) shows 1.
.show floatval ABS(-1) shows 0.000000 and error in console: Bad intrinsic function usage. missing ).

.show eval SQRT(030) shows 6.
.show eval SQRT(30) shows 5.
So with eval it appear to work properly.

.show floatval SQRT(030) shows 5.77...
.show floatval SQRT(30) shows 5.77...
It's like now it doesn't do the conversion from hex to decimal.

FLOATVAL doesn't show error in console if i put invalid code inside, like .show FLOATVAL arrraaa, where EVAL arrraaa does.

Also, is it possible to have as intrinsic functions also arcsin, arccos, arctan, arccotan? It should be easy to do since they are already in the c++ header <cmath.h> (http://www.cplusplus.com/reference/cmath/ [^]); cotan and arccotan appear to not be included, but cotan is 1/tan and arccotan is 90°-arctan (https://en.wikipedia.org/wiki/Inverse_trigonometric_functions [^]).
TagsNo tags attached.
Nightly VersionAutomated (specify build number)
Experimental FlagsNone
Option FlagsNone
Internal Build Number
Attached Files

- Relationships

-  Notes
(0003017)
Coruja (developer)
11-07-16 21:43

these intrinsic functions (FLOATVAL, ABS, ...) usually don't evaluate args, they just read them exactly as it is. So to make the function work properly the args must be already using the correct syntax

example:
<eval ABS(-1)> -> this works fine because EVAL can evaluate all values before the calculation, so it will first resolve ABS(-1) to 1 and later will call 'eval 1'

<floatval ABS(-1)> -> this will not work because FLOATVAL doesn't evaluate the args before the calculation. So instead resolve ABS(-1) to 1 and call 'floatval 1', it will thread ABS(-1) as an numeric value without change it. And since ABS(-1) is an string (text) and not an numeric value, FLOATVAL will fail

to fix this, you must evaluate these values before call intrinsic functions, like this:
<FLOATVAL <eval ABS(-1)>> = <FLOATVAL 1> = 1.000000

the same occur when you call these functions using hex args instead dec, like <FLOATVAL 0a>. The function will thread 0a as numeric, but will fail because it doesn't evaluate args so it doesn't know that 0a (hex) is the same of 10 (dec). So to make it work properly you must fist evaluate this value to dec using something like <FLOATVAL <eval 0a>> or <FLOATVAL 10>

- Issue History
Date Modified Username Field Change
23-01-16 15:57 nolok New Issue
11-07-16 21:43 Coruja Note Added: 0003017


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker