Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Feb 8, 2023
2 parents d51d575 + 863c035 commit 24bbd04
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
17 changes: 14 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/float.eo
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,20 @@
[] > float
# Tests that $ = x
[x] > eq
eq. > @
^.as-bytes
x.as-bytes
if. > @
and.
eq.
^.as-bytes > self-as-bytes!
00-00-00-00-00-00-00-00 > zero-as-bytes!
eq.
x.as-bytes > x-as-bytes!
zero-as-bytes
eq.
^.neg.as-bytes
x.neg.as-bytes
eq.
self-as-bytes
x-as-bytes

# Tests that $ < x
[x] > lt
Expand Down
17 changes: 14 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/int.eo
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,20 @@

# Tests that $ = x
[x] > eq
eq. > @
^.as-bytes
x.as-bytes
if. > @
and.
eq.
^.as-bytes > self-as-bytes!
00-00-00-00-00-00-00-00 > zero-as-bytes!
eq.
x.as-bytes > x-as-bytes!
zero-as-bytes
eq.
^.neg.as-bytes
x.neg.as-bytes
eq.
self-as-bytes
x-as-bytes

# Tests that $ < x
[x] > lt
Expand Down
8 changes: 1 addition & 7 deletions eo-runtime/src/main/java/org/eolang/Param.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,7 @@ public Bytes asBytes() {
} else if (Character.class.isInstance(ret)) {
res = new BytesOf((char) ret);
} else if (Double.class.isInstance(ret)) {
final double adjusted;
if (ret.equals(0.0)) {
adjusted = -0.0;
} else {
adjusted = (double) ret;
}
res = new BytesOf(adjusted);
res = new BytesOf((double) ret);
} else if (byte[].class.isInstance(ret)) {
res = new BytesOf((byte[]) ret);
} else {
Expand Down

0 comments on commit 24bbd04

Please sign in to comment.