分期付款公式
利息 = amt *r *[n/n+ (n-1/n)+ (n-2/n)+ …. + (2/n)+(1/n)]
= amt*r*1/n [n+(n-1)+(n-2)+....+2+1]
= amt*r*1/n *(nx(n+1)/2)
= amtr{[n(n+1)2]/n}
【聯合報/記者何醒邦/台北報導】
瞄準首購族購屋市場,多家房仲業者紛紛推出優惠房貸,償還期限最高還可達40年之久。
# Program name = ntp.py
# This program is for Nonstop server NTP client
# prerequirements : HP Nonstop OSS , Pyhton 2.4.2 (get it from ITUGLIB,http://ituglib.connect-community.org), and
# donwload ntplib-0.1.9 from Python Package Index
# You have to modify ntplib.py in ntplib-0.1.9 to accept ip address NTP. Here is snippet
# def request(self, host, version=2, port='ntp'):
# """make a NTP request to a server - return a NTPStats object"""
# # lookup server address
# #addrinfo = socket.getaddrinfo(host, port)[0]
# #family, sockaddr = addrinfo[0], addrinfo[4]
# family=2
# sockaddr=(host,123)
# You need to use Super Group to run the program.Because SETTIME is Super Group ONLY.
# Usage : gtacl -c "$(python ntp.py)"
import ntplib
import os
from time import ctime
c = ntplib.NTPClient()
response = c.request('XXX.XXX.XXX.XXX', version=3)
response.offset
response.version
ntptime=ctime(response.tx_time)
ntptimelist =ntptime.split()
newtime=ntptimelist[1]+' '+ntptimelist[2]+' '+ntptimelist[4]+','+ntptimelist[3]
#print ntplib.leap_to_text(response.leap)
#print response.root_delay
settimestring = "settime"+' '+newtime
#print settimestring
print "time"
#os.system('gtacl -c "time"')
#os.system('gtacl -c "status *"')
#os.system('gtacl -p fup "info \uitc.\$dev.cup.*"')