Method: RCSimCinterface.rcsim_make_value_numeric

Defined in:
ext/hruby_sim/hruby_rcsim_build.c

.rcsim_make_value_numeric(typeV, contentV) ⇒ Object

Creating a numeric value C object.



684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
# File 'ext/hruby_sim/hruby_rcsim_build.c', line 684

VALUE rcsim_make_value_numeric(VALUE mod, VALUE typeV, VALUE contentV) {
    // printf("rcsim_make_value_numeric\n");
    /* Get the type. */
    Type type;
    value_to_rcsim(TypeS,typeV,type);
    /* Create the value. */
    Value value = make_value(type,0);
    // printf("value=%p\n",value);
    /* Set it to numeric. */
    value->numeric = 1;
    value->capacity = 0;
    value->data_str = NULL;
    value->data_int = NUM2LL(contentV);
    // printf("value->data_int=%lld\n",value->data_int);
    /* Returns the C value embedded into a ruby VALUE. */
    VALUE res;
    rcsim_to_value(ValueS,value,res);
    return res;
}