Line | |
---|
1 | from typing import cast
|
---|
2 | import sys
|
---|
3 | import math
|
---|
4 | import random
|
---|
5 | from typing import List
|
---|
6 |
|
---|
7 |
|
---|
8 | class Math:
|
---|
9 | # Tests static function calls and references
|
---|
10 | @staticmethod
|
---|
11 | def main(args:List[str]) -> None:
|
---|
12 | # @param args the arguments of the call.
|
---|
13 | sys.stdout.write( ("ok1" if -1.0e0==-1. else "ko1")+'\n')
|
---|
14 | sys.stdout.write( ("ok2" if 1.==1. else "ko2")+'\n')
|
---|
15 | sys.stdout.write( ("ok3" if 1==+1 else "ko3")+'\n')
|
---|
16 | sys.stdout.write( ("ok4" if abs(-1)==1 else "ko4")+'\n')
|
---|
17 | sys.stdout.write( ("ok5" if abs(-1.5)==1.5 else "ko5")+'\n')
|
---|
18 | sys.stdout.write( ("ok6" if math.floor(-1.5)==-2 else "ko6")+'\n')
|
---|
19 | v:float = random.random()
|
---|
20 | sys.stdout.write( ("ok7" if v >= 0 and v <= 1 else "ko7")+'\n')
|
---|
21 | sys.stdout.write( ("ok8" if isinstance((cast(type,1.)),float) else "ko8")+'\n')
|
---|
22 |
|
---|
23 | if __name__ == "__main__":
|
---|
24 | Math.main(sys.argv[1:])
|
---|
Note:
See
TracBrowser
for help on using the repository browser.