Rational errors fix
- Better debug information on float errors (lines 231 and 251). - line 246 fixes ruby rational errors
This commit is contained in:
		
							parent
							
								
									990843a50b
								
							
						
					
					
						commit
						a5a12ecf21
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
					@ -228,7 +228,7 @@ rb_float_arg(VALUE arg, double *out, int argPos = 0)
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		rb_raise(rb_eTypeError, "Argument %d: Expected float", argPos);
 | 
							rb_raise(rb_eTypeError, "Argument %d: Expected float(got 0x%x)", argPos, rb_type(arg));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -243,11 +243,12 @@ rb_int_arg(VALUE arg, int *out, int argPos = 0)
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	case RUBY_T_FIXNUM :
 | 
						case RUBY_T_FIXNUM :
 | 
				
			||||||
 | 
						case RUBY_T_RATIONAL :
 | 
				
			||||||
		*out = FIX2INT(arg);
 | 
							*out = FIX2INT(arg);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		rb_raise(rb_eTypeError, "Argument %d: Expected fixnum", argPos);
 | 
							rb_raise(rb_eTypeError, "Argument %d: Expected fixnum(got 0x%x)", argPos, rb_type(arg));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue