Skip to content

Commit

Permalink
Showing 3 changed files with 0 additions and 49 deletions.
9 changes: 0 additions & 9 deletions spec/truffle/tags/core/kernel/rand_tags.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
fails:Kernel.rand returns an integer for a float argument greater than 1
fails:Kernel.rand returns a float for an argument between -1 and 1
fails:Kernel.rand ignores the sign of the argument
fails:Kernel.rand calls to_int on its argument
fails:Kernel.rand returns a float for an range argument where max is < 1
fails:Kernel.rand given an exclusive range returns an Integer between the two Integers
fails:Kernel.rand given an exclusive range returns a Float between the given Integer and Float
fails:Kernel.rand given an exclusive range returns a Float between the given Float and Integer
fails:Kernel.rand given an exclusive range returns a Float between the two given Floats
fails:Kernel.rand given an inclusive range returns an Integer between the two Integers
fails:Kernel.rand given an inclusive range returns a Float between the given Integer and Float
fails:Kernel.rand given an inclusive range returns a Float between the given Float and Integer
fails:Kernel.rand given an inclusive range returns a Float between the two given Floats
10 changes: 0 additions & 10 deletions spec/truffle/tags/core/kernel/srand_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1442,36 +1442,6 @@ public Object send(VirtualFrame frame, Object self, Object name, Object[] args,

}

@CoreMethod(names = "rand", isModuleFunction = true, optional = 1)
public abstract static class RandNode extends CoreMethodArrayArgumentsNode {

@Specialization
public double rand(NotProvided max) {
return ThreadLocalRandom.current().nextDouble();
}

@Specialization(guards = "max == 0")
public double randZero(int max) {
return ThreadLocalRandom.current().nextDouble();
}

@Specialization(guards = "max != 0")
public int randNonZero(int max) {
return ThreadLocalRandom.current().nextInt(max);
}

@Specialization(guards = "max == 0")
public double randZero(long max) {
return ThreadLocalRandom.current().nextDouble();
}

@Specialization(guards = "max != 0")
public long randNonZero(long max) {
return ThreadLocalRandom.current().nextLong(max);
}

}

@CoreMethod(names = "require", isModuleFunction = true, required = 1, unsafe = UnsafeGroup.LOAD)
@NodeChildren({
@NodeChild(type = RubyNode.class, value = "feature")

0 comments on commit b523bd4

Please sign in to comment.