Sha256: 2255207ff8510e4b1a498a856099b508681d8dfe9688ea8107227011bb083501
Contents?: true
Size: 699 Bytes
Versions: 17
Compression:
Stored size: 699 Bytes
Contents
module SPARQL; module Algebra class Operator ## # The SPARQL logical `rand` operator. # # @example # (rand) # # @see http://www.w3.org/TR/sparql11-query/#idp2130040 class Rand < Operator::Nullary include Evaluatable NAME = :rand ## # Returns a pseudo-random number between 0 (inclusive) and 1.0e0 (exclusive). Different numbers can be produced every time this function is invoked. Numbers should be produced with approximately equal probability. # # @return [RDF::Literal::Double] random value def apply RDF::Literal::Double.new(Random.rand) end end # Rand end # Operator end; end # SPARQL::Algebra
Version data entries
17 entries across 17 versions & 1 rubygems