This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
# In[1]: | |
import random | |
from pathlib import Path | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Neary equal needs this value | |
fileprivate let ALLOEABLE_ERROR = 1e-12 | |
// Custom operators | |
prefix operator / | |
infix operator **: MultiplicationPrecedence | |
// <Extentions for using float easily> | |
// Reciprocal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix operator / | |
public prefix func +(rhs: Rational) -> Rational // これいる? | |
{ | |
return Rational(rhs.pee, rhs.cue) | |
} | |
public prefix func -(rhs: Rational) -> Rational // 反数 | |
{ | |
return Rational(-rhs.pee, rhs.cue) | |
} |
NewerOlder