
D Tuples
By: a guest on
Aug 3rd, 2012 | syntax:
D | size: 0.34 KB | hits: 18 | expires: Never
// Returns Tuple!(feet, inches)
auto inchToFeet(int inches)
{
return tuple(inches / 12, inches % 12);
}
float inchToCm(int inches)
{
// Shit nigga is dat tuple taking two arguments?
return inchToCm(getFeetAndInches(inches).tupleof);
}
float inchToCm(int feet, int inches)
{
return (feet * inchPerFoot + inches) * cmPerInch;
}