You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: math.rb
    path of file: ./repos/truffleruby/src/main/ruby/truffleruby/core
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# Copyright (c) 2014, 2024 Oracle and/or its affiliates. All rights reserved. This
# code is released und
    
  def ldexp(fraction, exponent)
    result = Primitive.math_ldexp(fraction, exponent)
    if !Primitive.undefined?(result)
      result
    elsif Primitive.is_a?(exponent, Float) and exponent.nan?
      raise RangeError, 'float NaN out of range of integer'
    else
      ldexp(
        Truffle::Type.coerce_to_float(fraction),
        Primitive.rb_to_int(exponent))
    end