@@ -874,57 +874,47 @@ protected RubyString toSNaN(double value,
874
874
875
875
@ Specialization (guards = "hasNoExp(value)" )
876
876
protected RubyString toSNoExp (double value ) {
877
- return makeStringNode .executeMake (makeRopeNoExp (value ), Encodings .US_ASCII , NotProvided . INSTANCE );
877
+ return makeStringNode .executeMake (makeRopeNoExp (value ), Encodings .US_ASCII , CodeRange . CR_7BIT );
878
878
}
879
879
880
880
@ Specialization (guards = "hasLargeExp(value)" )
881
881
protected RubyString toSLargeExp (double value ) {
882
- return makeStringNode .executeMake (makeRopeLargeExp (value ), Encodings .US_ASCII , NotProvided . INSTANCE );
882
+ return makeStringNode .executeMake (makeRopeLargeExp (value ), Encodings .US_ASCII , CodeRange . CR_7BIT );
883
883
}
884
884
885
885
@ Specialization (guards = "hasSmallExp(value)" )
886
886
protected RubyString toSSmallExp (double value ) {
887
- return makeStringNode .executeMake (makeRopeSmallExp (value ), Encodings .US_ASCII , NotProvided . INSTANCE );
887
+ return makeStringNode .executeMake (makeRopeSmallExp (value ), Encodings .US_ASCII , CodeRange . CR_7BIT );
888
888
}
889
889
890
890
@ TruffleBoundary
891
- private Rope makeRopeSimple (double value ) {
892
- String str = Double .toString (value );
893
-
894
- return RopeOperations .encodeAscii (str , Encodings .US_ASCII .jcoding );
895
- }
896
-
897
- @ TruffleBoundary
898
- private Rope makeRopeNoExp (double value ) {
899
- String str = DF_NO_EXP .format (value );
900
- return RopeOperations .encodeAscii (str , Encodings .US_ASCII .jcoding );
891
+ private String makeRopeNoExp (double value ) {
892
+ return DF_NO_EXP .format (value );
901
893
}
902
894
903
895
@ TruffleBoundary
904
- private Rope makeRopeSmallExp (double value ) {
905
- String str = DF_SMALL_EXP .format (value );
906
- return RopeOperations .encodeAscii (str , Encodings .US_ASCII .jcoding );
896
+ private String makeRopeSmallExp (double value ) {
897
+ return DF_SMALL_EXP .format (value );
907
898
}
908
899
909
900
@ TruffleBoundary
910
- private Rope makeRopeLargeExp (double value ) {
911
- String str = DF_LARGE_EXP .format (value );
912
- return RopeOperations .encodeAscii (str , Encodings .US_ASCII .jcoding );
901
+ private String makeRopeLargeExp (double value ) {
902
+ return DF_LARGE_EXP .format (value );
913
903
}
914
904
915
905
protected static boolean hasNoExp (double value ) {
916
906
double abs = Math .abs (value );
917
- return abs == 0.0d || ((abs >= 0.0001d ) && (abs < 1_000_000_000_000_000.0d ));
907
+ return abs == 0.0 || ((abs >= 0.0001 ) && (abs < 1_000_000_000_000_000.0 ));
918
908
}
919
909
920
910
protected static boolean hasLargeExp (double value ) {
921
911
double abs = Math .abs (value );
922
- return (abs >= 1_000_000_000_000_000.0d );
912
+ return (abs >= 1_000_000_000_000_000.0 );
923
913
}
924
914
925
915
protected static boolean hasSmallExp (double value ) {
926
916
double abs = Math .abs (value );
927
- return (abs < 0.0001d ) && (abs != 0.0d );
917
+ return (abs < 0.0001 ) && (abs != 0.0 );
928
918
}
929
919
930
920
protected static Rope specialValueRope (double value ) {
0 commit comments