[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX() for negative inputs and unsigned types #175

Open
slayoo opened this issue Apr 16, 2018 · 2 comments
Open

FIX() for negative inputs and unsigned types #175

slayoo opened this issue Apr 16, 2018 · 2 comments
Assignees

Comments

@slayoo
Copy link
Member
slayoo commented Apr 16, 2018

As reported by @opoplawski on SF.net (https://sourceforge.net/p/gnudatalanguage/bugs/622/):

test_fix.pro checks for the results of FIX() for negative inputs and unsigned returned types. The IDL docs (http://www.exelisvis.com/docs/FIX.html) don't reference this situation explicitly, but it seems like an inherently undefined operation and as such architecture/implementation specific. And while gdl appears to match IDL on x86_64, e.g.:

GDL> print,FIX(-1.01,type=12)
   65535
IDL> print,FIX(-1.01,type=12)
   65535

on arm this is returning:

GDL> print,FIX(-1.01,type=12)
   0

I have no access to IDL on non-x86 architectures so I can't compare. But my suggestion would be to not test this situation.

@slayoo
Copy link
Member Author
slayoo commented Apr 16, 2018

furter comment by @GillesDuvert:

The test comments by Alain specifically refer to problems with negative inputs reported by a "Nicolas". Everybody could remove the test for negative values, but I would prefer Alain reviews this. Perhaps we should make the test only for intel architectures, or simply report the errors but let the test pass.

@GillesDuvert
Copy link
Contributor

FIX has now /IMPLIED_PRINT (related to #48).
The various integer conversions have to be re-checked, as there are subtle differences (try print, long(!values.f_infinity) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants