先日の Python コードのバグ(整数で計算されてしまうため結果が異なる).
原因はすぐわかるが,対応は悩む所.
コードを分解して動作を確認してみた.
def r_cs_o (c , s) : return ( ( c*c ) / ( 8 *s ) + s/2 )
def r_cs_n (c , s) : return ( ( c*c ) / ( 8.*s ) + s/2. )
print (6*6)
print (8*1)
print (36/8)
print (36/8.)
print (1/2)
print (1/2.)
print ("")
print (36/8 +1/2 )
print (36/8.+1/2.)
print ("")
print (r_cs_o(6,1))
print (r_cs_n(6,1))

https://docs.python.org/ja/3/howto/pyporting.html?highlight=除算
Synology NAS DSM では Python 2.7 が標準で入っているみたい.
「パッケージ センター」で Python3 を追加できる.
C:\Program Files\Microsoft Office\Office14>cd C:\Users\Iwao\AppData\Local\Temp
C:\Users\Iwao\AppData\Local\Temp>ssh -l Iwao -p 2200 192.168.1.116
Iwao@192.168.1.116's password:
Iwao@DS116:~$ python3
Python 3.5.1 (default, Jan 29 2018, 14:16:30)
[GCC 4.9.3 20150311 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Iwao@DS116:~$ python2
Python 2.7.12 (default, May 12 2020, 04:48:57)
[GCC 4.9.3 20150311 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Iwao@DS116:~$ python
Python 2.7.12 (default, May 12 2020, 04:48:57)
[GCC 4.9.3 20150311 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Iwao@DS116:~$

ASUSTOR NAS ADM では入ってない.「App Central」でインストール可能.

2020/11/20
QNAP NAS での Python3 は,他の NAS と異なるみたい.
opkg install python3 でインストールしなければならなかった.
https://mish.myds.me/wordpress/dev/2020/08/29/ts253d-setup-3-opkg/
https://mish.myds.me/wordpress/dev/2020/08/17/ts-253d-setup-7-python3/

