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

RFC: Ability to change rounding mode for all floats (cf. #2976) #3149

Merged
merged 11 commits into from
Sep 2, 2013
Prev Previous commit
Next Next commit
Fix bug while parsing fenv_constants.h
  • Loading branch information
andrioni committed Aug 27, 2013
commit 454f61a0523f98fa20f5d5f38ac1644e370c7f4b
2 changes: 1 addition & 1 deletion base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ errno_h.jl:
@$(PRINT_PERL) echo '#include "errno.h"' | $(CPP) -dM - | perl -nle 'print "const $$1 = int32($$2)" if /^#define\s+(E\w+)\s+(\d+)\s*$$/' | sort > $@

fenv_constants.jl: ../src/fenv_constants.h
$(QUIET_PERL) ${CC} -E -P -DJULIA ../src/fenv_constants.h | perl -nle 'print "$$1 0o$$2" if /^(\s*const\s+[A-z_]+\s+=)\s+(0[0-9]*)\s*$$/; print "$$1" if /^\s*(const\s+[A-z_]+\s+=\s+([1-9]|0x)[0-9A-z]*)\s*$$/' > $@
$(QUIET_PERL) ${CC} -E -P -DJULIA ../src/fenv_constants.h | tail -n 8 > $@

file_constants.jl: ../src/file_constants.h
@$(PRINT_PERL) $(CPP) -P -DJULIA ../src/file_constants.h | perl -nle 'print "$$1 0o$$2" if /^(\s*const\s+[A-z_]+\s+=)\s+(0[0-9]*)\s*$$/; print "$$1" if /^\s*(const\s+[A-z_]+\s+=\s+([1-9]|0x)[0-9A-z]*)\s*$$/' > $@
Expand Down
6 changes: 5 additions & 1 deletion src/fenv_constants.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include <fenv.h>

const JL_FE_INEXACT = FE_INEXACT
const JL_FE_UNDERFLOW = FE_UNDERFLOW
const JL_FE_OVERFLOW = FE_OVERFLOW
const JL_FE_DIVBYZERO = FE_DIVBYZERO
const JL_FE_INVALID = FE_INVALID
const JL_FE_TONEAREST = FE_TONEAREST
const JL_FE_UPWARD = FE_UPWARD
const JL_FE_DOWNWARD = FE_DOWNWARD
Expand Down