¥«¥é¥Ä¥ÐË¡¤Ç»÷Èó¥´¡¼¥¹¥È°Å»»

¥´¡¼¥¹¥È°Å»»¤è¤êÁᤤ¡ª...¾ì¹ç¤â¤¢¤ë·×»»ÊýË¡....(´À


¥´¡¼¥¹¥È°Å»»¤È¤¤¤¦¤Î¤ò¡¢¾¯¤·Á°¤ËÃΤê¤Þ¤·¤¿¡£
¥´¡¼¥¹¥È°Å»»¤¬É®»»¤Ç¤¢¤ë¤Ê¤é¡¢¾è»»£´²ó¡¦²Ã»»£³¡Á£´²ó¤Î±é»»¤Ë¤Ê¤ê¤Þ¤¹¡£

Î㤨¤Ð¡¢48x53¤ò¹Í¤¨¤Æ¤ß¤ë¤È

¡ÚÄ̾ï¤ÎÉ®»»¡Û
     4 8
   x 5 3
---------
     2 4
   1 2
   4 0
 2 0
---------
 2 5 4 4


¡Ú¥´¡¼¥¹¥È°Å»»¡Û
Àé¤Î°Ì¤È°ì¤Î°Ì¤òÀè¤Ë½Ð¤·¤Æ¡¢»Ä¤ê¤ò¸å¤«¤é²Ã»»¤·¤Þ¤¹¡£
Ä̾ï¤ÎÉ®»»¤Î²Ã»»¤Î½ç½ø¤òÆþ¤ìÂؤ¨¤Æ¤¤¤ë¤³¤È¤¬¤ï¤«¤ê¤Þ¤¹¡£
(¾Ü¤·¤¯¤Ï½ñÀÒ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£µû¤Î³¨¤ò»È¤Ã¤¿¤ï¤«¤ê¤ä¤¹¤¤¤â¤Î¤Ç¤¹)


­¡ (4x5)x10 + 8x5 = 240          ...Àé¤Î°Ì(2)
­¢                   40x10 + 8x3
                  =  424         ...°ì¤Î°Ì(4)
­£                   42 + 4x3    ...Àµ³Î¤Ë¤Ï°ì¤Î°Ì¤È½½¤Î°Ì¤Çʬ²ò¤·¤Æ²Ã»»¤·¤Þ¤¹
                  =  54
-----------------------------
                    2544


¡Ú¥«¥é¥Ä¥Ð¡Û
¤½¤ì¤Ê¤é¤Ð¤È¡¢¥´¡¼¥¹¥È¤Ã¤Ý¤¤¥«¥é¥Ä¥ÐË¡¤ò¹Í¤¨¤Æ¤ß¤Þ¤·¤¿¡£
¤È¤Ï¸À¤Ã¤Æ¤âñ½ã¤Ë ´ð¿ô¤ò£±£° ¤Ë¤·¤¿¤À¤±¤Ç¤¹¤¬¡£
ƱÍͤËÀé¤Î°Ì¤È°ì¤Î°Ì¤òÀè¤Ë½Ð¤·¤Æ¡¢»Ä¤ê¤ò¸å¤«¤é·×»»¤·¤Þ¤¹¡£

­¡ (4x5)x100 + (8x3) = 2024  ¾å°Ì·åƱ»Î¤Î¾è»»¤È²¼°Ì·åƱ»Î¤Î¾è»»¤Ê¤Î¤Ç·«¤ê¾å¤¬¤ê¤Ï¤Ê¤¤¡£Ê¤٤ë¤À¤±¡£
­¢ (4x5)     + (8x3) =  44   ­¡¤Î¾å°ÌÉôʬ¤È²¼°ÌÉôʬ¤Î²Ã»»¡£20+24+2
------------------------------
                        46
­£ -(4-8)x(5-3)      =   8   ¥«¥é¥Ä¥ÐË¡¤Î¥ß¥½¡£
------------------------------
                        54
------------------------------
                       2544

¾å¤ÎÀâÌÀ¤Ç¤Ï¤ï¤«¤ê¤Ë¤¯¤¤¤Î¤Ç¡¢·×»»ÊýË¡¤ò´Êñ¤Ê¥Ñ¥¿¡¼¥ó¤Ë¤·¤Þ¤¹¡£

­¡¾å°Ì·å¤È²¼°Ì·åƱ»Î¤ò³Ý¤±¤Æʤ٤ޤ¹¡£(¢ª2024)
­¢²¼£³·å¤ò­¤·¤Þ¤¹(0+2+4¢ª6)
­£¾å£³·å¤ò­¤·¤Þ¤¹(2+0+2¢ª4)
...¤³¤³¤Ç¸µ¤Î½½¤Î°Ì¤È°ì¤Î°Ì¤Î¿ô¡Ö0,2¡×¤Ï˺¤ì¤Æ¡¢2464¤òµ­²±¤¹¤ë¡£
­¤³Ý¤±¤ë¿ô¡¢³Ý¤±¤é¤ì¤ë¿ô¡¢¤½¤ì¤¾¤ì½½¤Î°Ì¤È°ì¤Î°Ì¤Îº¹¤ò¼è¤Ã¤Æ³Ý¤±¤Þ¤¹¡£(-4x2¢ª-8)
­¥Éä¹æȿž(-8¢ª+8)
­¦ ­£¤È­¢¤Ç¤Ç¤­¤¿¿ô¤Ë¡¢­¥¤Î¿ô¤ò­¤·¤Þ¤¹¡£(46+8¢ª54)
Ê»¤»¤Æ·Ò¤²¤ë¤È¡¢2544¤Î½ÐÍè¾å¤¬¤ê¡£

­¤¤¬¥«¥é¥Ä¥ÐË¡¤Î¥ß¥½¤Ç¡¢¤¿¤¹¤­³Ý¤±¤Î³Ý¤±»»(4x3,8x5)¤ÏɬÍפ¢¤ê¤Þ¤»¤ó¡£

¤¤¤¯¤Ä¤«·×»»¥µ¥ó¥×¥ë¤òʤ٤ޤ¹¡£

¤³¤ì¤â¥«¥é¥Ä¥Ð¤Î¸ú²Ì¤¬Îɤ¯½Ð¤Æ¤¤¤Þ¤¹¡£

ºÇ¤â¸ú²Ì¤¬½Ð¤ë¤Î¤Ï¡¢½½¤È°ì¤Î°Ì¤¬Æ±¤¸¿ô»ú¤Î¾ì¹ç¤Ç¡¢

´Êñ¤¹¤®¤Æ¶Ã¤­¤Þ¤¹¡£

»ÄÇ°¤Ê¤¬¤éÁ´¤Æ¤Î¿ô»ú¤ÎʤӤǴÊñ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¼¡¤ÎÎã¤ò¤´Í÷¤¯¤À¤µ¤¤¡£

¤³¤ÎÎã¤À¤È¡¢·å¾å¤²¤È·å²¼¤²¤¬È¯À¸¤¹¤ë¤Î¤Ç¡¢¾¯¤·ÌÌÅݤǤ¹¡£

¥«¥é¥Ä¥ÐË¡¤Ë¤Ä¤¤¤Æ¾Ü¤·¤¯¤Ï
http://ja.wikipedia.org/wiki/%E3%82%AB%E3%83%A9%E3%83%84%E3%83%90%E6%B3%95
°ìÈ̤ˤϡ¢Ê¬³äÅý¼£Ë¡¤È¤·¤Æͭ̾¤Ç¡¢¾è»»¤Î¾¤Ë¤â½ü»»¤äÊ¿Êýº¬¤Î¿ÇÜĹ¿ô·×»»¤Ç»È¤ï¤ì¤Þ¤¹¡£(Ãí)
KaratsubaÇî»Î ¤â¤³¤ó¤Ê»È¤¤Êý¤µ¤ì¤ë¤È¤Ï¡¢»×¤ï¤Ê¤«¤Ã¤¿¤Ç¤·¤ç¤¦¡£


¡Ú¤Þ¤È¤á¡Û
´ö¤Ä¤«¤ÎÎã¤Ç¤Ï¡¢¥«¥é¥Ä¥ÐË¡¤ÎÊý¤¬Áᤤ¤è¤¦¤Êµ¤¤â¤·¤Þ¤¹¤¬¡¢
¥´¡¼¥¹¥È°Å»»¤ÎÎɤµ¤Ï¡¢Ã±½ã²½¤µ¤ì¤¿¾®¤µ¤Ê²Ã»»¤òÁȤ߹ç¤ï¤»¤ë¤³¤È¤Ç¡¢¾®³Ø¹»Äã³Øǯ¤Ç¤â·×»»¤Ç¤­¤ë¤È¤³¤í¤Ë¤¢¤ê¤Þ¤¹¡£
¥Ñ¥¿¡¼¥ó¤Ë¤è¤Ã¤ÆÆñ°×ÅÙ¤¬¤¢¤Þ¤ê¾å²¼¤¹¤ë¤Î¤Ï¡¢Äã³Øǯ¤Ç¤Ï¸·¤·¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£

¥«¥é¥Ä¥ÐË¡¤Î¾ì¹ç¡¢¾è»»²ó¿ô¤¬¸º¤ê¤Þ¤¹¤¬­¥­¦¤¬¸º»»¤Ë¤Ê¤ë¾ì¹ç¤â¤¢¤ë¤Î¤Ç¤³¤³¤¬°Å»»¾å¤Îµ´Ìç¤Ë¤Ê¤ê¤Þ¤¹¡£
Î㤨¤Ð¡¢¾è¿ô¤äÈï¾è¿ô¤Ë22¤ä77¤Ê¤É¡¢Æ±¤¸¿ô»ú¤¬Ê¤ó¤Ç¤¤¤ë¾ì¹ç¤Ï­¤­¥¤¬¤¤¤é¤Ê¤¯¤Ê¤ë¤Î¤Ç´Êñ¤Ç¤¹¤¬¡¢ºÇ¸å¤ÎÎã¤Ê¤É¥«¥é¥Ä¥Ð°Å»»¤Ç²ò¤¯¤Î¤Ï¸º»»¤Ë¤è¤ë·å²¼¤²¤¬¤¢¤ë¤Î¤ÇÌÌÅݤǤ¹¡£
¤Þ¤¿¡¢¾®¤µ¤Ê·å¿ô¤Ç¤¢¤ì¤Ð¿Í´Ö¤Ë¤È¤Ã¤Æ¤Ï¡¢²Ã»»¤è¤ê¾è»»¤ÎÊý¤¬Áᤤ¤Î¤Ç¡¢
ËÜÍè¤Î¥«¥é¥Ä¥ÐË¡¤Î¸ú²Ì¤Ï¡¢Á´¤¯¤È¸À¤Ã¤Æ¤¤¤¤Äø¤¢¤ê¤Þ¤»¤ó¡£(Ãí)

£²·å£²·å¤Þ¤Ç¤·¤«ÄÌÍѤ·¤Ê¤¤¤È¤«¡Ö¤½¤í¤Ð¤ó¡×¤ÎÊý¤¬Îɤ¤¤È¤«ÈãȽŪ¤Ê°Õ¸«¤â»¶¸«¤·¤Þ¤¹¤¬¡¢
¥´¡¼¥¹¥È°Å»»¤Ï¡¢¥¤¥á¡¼¥¸(µû¥Ñ¥¿¡¼¥ó)¤Ç´Êñ¤Ë¤ï¤«¤ê¤ä¤¹¤¯·×»»ÊýË¡¤ò²òÀ⤷¤¿¤È¤¤¤¦ÅÀ¤Ç¤Ï¡¢
º£¤Þ¤Ç¤Ê¤«¤Ã¤¿¿·¤·¤¤»î¤ß¤Ç¤¢¤ê¡¢¤Á¤ç¤Ã¤È¿¿»÷¤·¤Æ¤ß¤¿¤¯¤Ê¤ê¤Þ¤·¤¿¡£


¤É¤¦¤Ç¤âÎɤ¤¤³¤È¤Ç¤¹¤¬¡¢¤É¤³¤Î¥Ú¡¼¥¸¤â¡Ö48 x 53¡×¤ò»²¹Í¤Ë¤·¤Æ¤¤¤ë¤Î¤Ç¡¢
48x53¤ÎÅú¤¨¤À¤±¤Ï³Ð¤¨¤Á¤ã¤Ã¤Æ¤¤¤ë¿Í¤¬¤¤¤ë¤Î¤Ç¤Ï¤Ê¤¤¤À¤í¤¦¤«¡£



Tags: ¥×¥í¥°¥é¥à¥á¥â
³¤­¤òÆɤà¡ä¡ä
author : HUNDREDSOFT | - | -

Windows7¤Ç´Êñ¤Ë¥Þ¥ë¥Á¥¿¥Ã¥Á¤ò»î¤¹

Windows7¤Ç´Êñ¤Ë¥Þ¥ë¥Á¥¿¥Ã¥Á¤ò»î¤¹ÊýË¡¤È¤·¤Æ¡¢ "Multi-Touch Vista" ¤¬¤¢¤ê¤Þ¤¹¡£
̾Á°¤ÎÄ̤ꡢ¤½¤ì¤Û¤É¿·¤·¤¤¥½¥Õ¥È¤Ç¤Ï¤Ê¤¤¤Î¤Ç¤´Â¸¤¸¤ÎÊý¤â¤¤¤ë¤Ç¤·¤ç¤¦¡£

£²¤Ä¤Î¥Þ¥¦¥¹ÆþÎϤò£²¤Ä¤Î¥¿¥Ã¥Á¥Ý¥¤¥ó¥È¤Ë¸«Î©¤Æ¤Æ¡¢
¥Þ¥ë¥Á¥¿¥Ã¥Á´Ä¶­¤ò¼Â¸½¤·¤Æ¤¯¤ì¤ë¥É¥é¥¤¥Ð¤È¥³¥ó¥È¥í¡¼¥ë¥½¥Õ¥È¤Ç¤¹¡£

Virtual´Ä¶­¤Ç¤³¤ì¤ò²¿¤È¤«Æ°¤«¤»¤Ê¤¤¤«»î¤·¤¿¤Î¤Ç¤¹¤¬¡¢
VMware, VirtualPC, VirtualBox ¤¤¤º¤ì¤âÆ°¤«¤»¤Þ¤»¤ó¤Ç¤·¤¿¡£

¥É¥é¥¤¥Ð¤Îǧ¼±¤Þ¤Ç¤Ï¤Ç¤­¤Æ¡¢¥³¥ó¥È¥í¡¼¥ë¥Ñ¥Í¥ë¤Ë
¡Ö¥Ú¥ó¤È¥¿¥Ã¥Á¡×¤¬Äɲ䵤ì¤ë¤È¤³¤í¤Þ¤Ç¤Ï¹Ô¤¯¤Î¤Ç¤¹¤¬
Multitouch.Configuration.WPF.exe¤Î"Configuer device"¤Ç
Block native windows...¤Î¥Á¥§¥Ã¥¯¤òÆþ¤ì¤ë¤È
¥Þ¥¦¥¹¤¬°ìÀÚ¸ú¤«¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
¤ä¤Ï¤ê¼Â´Ä¶­¤¬É¬ÍפʤΤ«¤â¤·¤ì¤Þ¤»¤ó¡£

¼Â´Ä¶­¤Ç¤¢¤ì¤Ð¡¢³µ¤ÍÌäÂê¤Ê¤¯»È¤¨¤ë¤Î¤Ç¤¹¤¬¡¢
¥¹¥¿¡¼¥È¥á¥Ë¥å¡¼¤ä¥¿¥¹¥¯¥Þ¥Í¥¸¥ã¡¼¤ò³«¤±¤ë¤È¤Á¤ç¤Ã¤Èº¤¤Ã¤¿ÌäÂ꤬ȯÀ¸¤·¤Þ¤¹¡£
­¡¥¹¥¿¡¼¥È¥á¥Ë¥å¡¼¾å¤Ë¡¢¥¿¥Ã¥Á¤ÎÀÖ¤¤¡û¤Î¥Þ¡¼¥¯¤¬É½¼¨¤µ¤ì¤Ê¤¤¡£
­¢¥¿¥¹¥¯¥Þ¥Í¡¼¥¸¥ã¡¼¾å¤ÇÁàºî¤Ç¤­¤Ê¤¤¡£

­¢¤Ë¤Ä¤¤¤Æ¤Ï¡¢
Multitouch.Service.Console.exe,Multitouch.Driver.Console.exe¤ò
´ÉÍý¼Ô¤È¤·¤Æ¼Â¹Ô¤¹¤ì¤Ð²Äǽ¤Ç¤¹¤¬­¡¤ÎÌäÂ꤬¤¢¤ë¤Î¤Ç¡¢
´ÉÍý¼Ô¸¢¸Â¤Ç¼Â¹Ô¤·¤Æ¤¤¤ëWindow¾å¤Ë¥¿¥Ã¥Á¥Þ¡¼¥¯¤òɽ¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤º¤Ë¡¢
´ÉÍý¼Ô¥¢¥×¥ê¤ÎWindowÇØÌ̤˥ޡ¼¥¯¤¬É½¼¨¤µ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£

"Multi-Touch Vista"¤Ï¡¢¥³¡¼¥É¸ø³«¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç
multitouchvista-30935.zip¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ
Multitouch.InputProviders.sln¤òVS2010¤Ç³«¤¯¤È¡¢
DebugCursor.cs¤¬¥Þ¡¼¥¯¤òɽ¼¨¤·¤Æ¤¤¤ë¤³¤È¤¬¤ï¤«¤ê¤Þ¤¹¡£

Z-Order¤Ë´Ø¤¹¤ëÌäÂê¤Ç¤¹¤¬¡¢¾ï¤ËºÇÁ°Ì̤˥桼¥¶¡¼Window¤òɽ¼¨¤¹¤ëÊýË¡¤Ï¡¢
Windows£Ï£Ó¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤âÊѤï¤ê¤Þ¤¹¡£

¡¦Form¤Î»ØÄê¤äCreateWindow¤ÇTopMost¤ò»ØÄꤹ¤ë
¡¦SetForegroundWindows¤äAttachThreadInput¤Î¸Æ¤Ó½Ð¤·
¡¦BringWindowToTop¤Î¸Æ¤Ó½Ð¤·

Åù¤¬¤¢¤ê¤Þ¤¹¤¬¡¢

Windows7¤ÇC#¤Ê¤é¡¢Control.BringToFront()¤ò»È¤¦¤Î¤¬´Êñ¤Ç¤¹¡£

DebugCursor¤ò¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¤Î¤Ï¡¢DeviceStatus¥¯¥é¥¹¤Ç¤¹¤Î¤Ç
SyncUpdateLocation()¤Ë°ì¹ÔÄɲä·¤Þ¤¹¡£


void SyncUpdateLocation(object state)
{
   debugCursor.BringToFront(); //<-------------- ¤³¤Î¹Ô¤òÄɲÃ
   debugCursor.Location = new Point(Location.X - debugCursor.Width / 2, Location.Y - debugCursor.Height / 2);
}



¤³¤ì¤òBuild¤·¤Æ¡¢Output¥Õ¥©¥ë¥À¤Ë½ÐÎϤµ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤¹¤ì¤Ð¡¢
­¡¥¹¥¿¡¼¥È¥á¥Ë¥å¡¼¾å¤Ë¡¢¥¿¥Ã¥Á¤ÎÀÖ¤¤¡û¤Î¥Þ¡¼¥¯¤¬É½¼¨¤µ¤ì¤Ê¤¤¡£
­¢¥¿¥¹¥¯¥Þ¥Í¡¼¥¸¥ã¡¼¾å¤ÇÁàºî¤Ç¤­¤Ê¤¤¡£
¤ÎÌäÂ꤬²ò·è¤·¤Þ¤¹¡£




Tags: ¥×¥í¥°¥é¥à¥á¥â¡¡VirtualPC´ØÏ¢¡¡Windows7(x64)´ØÏ¢
author : HUNDREDSOFT | - | -

FaceBook¤Î¥á¥â¡¢¥µ¥ó¥×¥ë¥¢¥×¥ê

­¡ ¥¿¥¤¥à¥é¥¤¥ó¤«¤éÌ᤹¡£¡Ê¥¦¥©¡¼¥ë¤Ë¡Ë

2012/3/24¤«¤éFaceBook¤Î¥¦¥©¡¼¥ë¤¬Çѻߤˤʤꡢ¥¿¥¤¥à¥é¥¤¥ó¤Ë¤Ê¤ë¡£
Ìñ²ð¤Ê¤Î¤Ï¡¢°ì¸«¡¢»î¸³±¿ÍÑÃæ¤È»×¤ï¤»¤ë¥¿¥¤¥à¥é¥¤¥ó¤Î¥×¥ì¥Ó¥å¡¼¤ò¤Ä¤Ä¤¤¤Æ¤·¤Þ¤¦¤È¡¢2Å٤ȡ¢¥¦¥©¡¼¥ë¤ËÌá¤ì¤Ê¤¯¤Ê¤ë¤³¤È¤À¡£
¤³¤ì¤Ï¡¢IE8°Ê¹ß¤¬³ºÅö¤¹¤ë¤é¤·¤¤¡£

¸½¾õ¤Î²óÈòºö¤È¤·¤Æ¤Ï¡¢IEµ¯Æ°¸å¡¢F12¤ÇIE¤Î³«È¯View¤òɽ¼¨¤·¤Æ¡¢
¥á¥Ë¥å¡¼¤Î¡Ö¥Ö¥é¥¦¥¶¥â¡¼¥É¡×¤òIE7¤ËÊѤ¨¤ë¤·¤«¤Ê¤¤¤é¤·¤¤¡£

3/24¤Ë¤Ï¤Ï¤Ã¤­¤ê¤·¤Þ¤¹¤¬
¿·¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏIE8°Ê¹ß¤·¤«Âбþ¤·¤Ê¤¤¤Î¤À¤í¤¦¤«¡£
MS¤â¡¢3·î¤«¤é¤ÎWindowsUpdate¤Ç̵¾ò·ï¤ËIE8²½¤ò¤¹¤ë¤é¤·¤¤¤Î¤Ç¡¢
¤³¤ì¤ËÊ»¤»¤¿¤È¤¤¤¦¤³¤È¤À¤í¤¦¤«¡£


-------
­¢ Win7¡ÜIE9¤Ç¿®ÍêºÑ¤ß¥µ¥¤¥È¤ËÀßÃÖ¤·¤¿¡Ö¤¤¤¤¤Í¥Ü¥¿¥ó¡×¤¬¤¦¤Þ¤¯µ¡Ç½¤·¤Ê¤¤¡£

°ìÈÌŪ¤Ë¤Ï
http://developers.facebook.com/docs/reference/plugins/like/
¤Ç¡¢Like¥Ü¥¿¥ó¤Î¤Ò¤Ê·¿¤òºîÀ®¤·¤Æ¡¢HP¤ËÄ¥¤êÉÕ¤±¤Þ¤¹¡£

¥Í¥Ã¥È¥ï¡¼¥¯¾ò·ï¤Ï¼ï¡¹ÍÍ¡¹¤Ç¤¢¤ë¤Î¤Ç°ì³µ¤Ë¸À¤¨¤Þ¤»¤ó¤¬¡¢
Win7+IE9¤ÎÁȤ߹ç¤ï¤»¤Ç¡¢¿®ÍêºÑ¤ß¥µ¥¤¥È¤ËÀßÃÖ¤·¤¿¡Ö¤¤¤¤¤Í¥Ü¥¿¥ó¡×¤ò²¡¤¹¤È
http://www.facebook.com/connect/connect_to_external_page_widget_loggedin.php?social_plugin=like&external_page_url=<»ØÄê¤Îurl>#_=_
¤Î¥Ö¥é¥ó¥¯¥Ú¡¼¥¸¤¬³«¤¤¤Æ¤·¤Þ¤¦¡£
Ä̾ï¤Ê¤é¡¢¥³¥á¥ó¥ÈÆþÎϤ¬¸½¤ì¤ë¤Ï¤º¤À¡£

ÂÌÌܤʾì¹ç¤Ë¤Ï¾å¤Ç½ñ¤¤¤¿¡¢F12¤ÇIE7¸ß´¹¤ËÊѤ¨¤Æ¤â¼ºÇÔ¤¹¤ë¡£
http://developers.facebook.com/tools/lint/
¤Ç¤âÆäËÌäÂê¤Ï¸¡½Ð¤µ¤ì¤Ê¤¤¡£

¥Ù¡¼¥¿ÈǤÎWin8CP+IE10¤À¤È¾¯¤·Ê£»¨¤Ç
¡¦¥á¥È¥íÈÇ¡¦¡¦¡¦¥Ö¥é¥ó¥¯¥Ú¡¼¥¸¤¬³«¤¯¡£
¡¦DeskTopÈÇ¡¦¡¦¡¦¥Ö¥é¥ó¥¯¤Ï½Ð¤º¡¢¤¤¤¤¤Í¤â²¡¤»¤ë¤¬¡¢¥³¥á¥ó¥È¤¬³«¤«¤Ê¤¤¡£

¾¯¤Ê¤¯¤È¤â¡¢¥¤¥ó¥È¥é´Ä¶­²¼¤Ç¤Ï¡Ö¤¤¤¤¤Í¡×¤ò»È¤ï¤Ê¤¤Êý¤¬Îɤµ¤½¤¦¤À¡£


-------
­£ FaceBook¥µ¥ó¥×¥ë¥¢¥×¥ê javaScript SDK¤Çuser¾ðÊó¤Îɽ¼¨

(2012.8)¸½ºß¡¢¤³¤ÎÊýË¡¤Çuser¾ðÊó¤Ïɽ¼¨¤Ç¤­¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿¡£

¥í¥°¥ª¥ó¤·¤Æ¤¤¤ë¤³¤È¤¬¾ò·ï¤Ë¤Ê¤ë¤¬¡¢
¥í¥°¥ª¥ó¤·¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢¡Ö¤¤¤¤¤Í¡×¤ò²¡¤¹¤È¥í¥°¥ª¥ó¤¬Í׵ᤵ¤ì¤ë¡£
¤³¤Î»þ¤ËºÆÅÙ¡¢FB.init()¤ò¸Æ¤Ó½Ð¤·¤Æuser¾ðÊó¤ò¼èÆÀ¤Ç¤­¤¿¡£

¤¤¤º¤ì¤Ë¤·¤Æ¤â¡¢¥æ¡¼¥¶¡¼¤Ëµ¤¤Å¤«¤ì¤º¤Ë¡¢
FaceBook¤Îuser¾ðÊ󤬼èÆÀ¤Ç¤­¤Æ¤·¤Þ¤¦¤³¤È¤Ï¡¢¤È¤Æ¤â´í¸±¤À¡£

DeveropperÅÐÏ¿¤·¤Æ¥¢¥×¥êID¤ò¼èÆÀ¤¹¤ì¤Ð¡¢FaceBook¤ÎSDK¤ò»È¤Ã¤¿¥Ú¡¼¥¸¤¬¹¥¤­¤ÊHP¾å¤Ë¹½ÃۤǤ­¤ë¡£
FaceBook¥­¥ã¥ó¥Ð¥¹¤Ï¡¢https:¤Î¥¢¥É¥ì¥¹¤¬É¬ÍפÀ¤¬¡¢
FaceBook¥­¥ã¥ó¥Ð¥¹¤òÍøÍѤ·¤Ê¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢¤É¤³¤Ë¤Ç¤âÃÖ¤±¤ë¡£
¤Ä¤Þ¤ê¡¢ÌîÎÉ¥¢¥×¥ê¤Ç¤¢¤ë¡£
˺¤ì¤½¤¦¤Ê¤Î¤Ç¥á¥â¡£

°ìÈÌŪ¤Ê¡Ö¤¤¤¤¤Í¥Ü¥¿¥ó¡×¤òÇÛÃÖ¤¹¤ë¡¢¼¡¤Î¤è¤¦¤Êhtml¤òÍÑ°Õ¤¹¤ë¡£


<!DOCTYPE html>

<!--- xmlns¤Ï¡¢IEÉÔ¶ñ¹ç¤Î¤ª¤Þ¤¸¤Ê¤¤¡¢¤Û¤È¤ó¤É¸ú²Ì¤Ï¤Ê¤¤ --->
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<!--- ¤³¤³¤Î¥á¥¿Éô¤Ï¡¢¤¤¤¤¤Í¥Ü¥¿¥ó¤Ç¤Î¤ßɬÍפʤâ¤Î¤Ç¤¹¡£ --->
<meta property="og:title" content="xxxxxx" />
<meta property="og:type" content="xxxxx" />
<meta property="og:url" content="http://www.xxxxxxxxxx.xx.xx/" />
<meta property="og:image" content="http://www.xxxxxxxxx.xx.xx/xxxx.gif" />
<meta property="og:site_name" content="xxxxxx" />
<meta property="fb:admins" content="nnnnnnnnnnnnnnn" />
<!--- ¤¤¤¤¤Í¥á¥¿ ¤³¤³¤Þ¤Ç¡£ --->

</head>
<body>

<!--- FaceBook¥¢¥×¥ê --->
<div id="fb-root"></div>
<script script type="text/javascript" src="http://www.xxxxxxxxxxx.xx.xx/core.js"></script>
<!--- FaceBook¥¢¥×¥ê ¤³¤³¤Þ¤Ç¡£ --->

<!--- ¤è¤¦¤³¤½¡§£ø£ø¤µ¤ó --->
<div id="username"></div>

<!--- ¥æ¡¼¥¶¡¼¾ðÊóɽ¼¨Éô --->
<div id="userinf"></div>

<!--- ͧ¿Í¾ðÊóɽ¼¨Éô --->
<div id="friendinfo"></div>
<br />

<!--- ¤¤¤¤¤Í¥Ü¥¿¥ó --->
<div id="iinebutton"></div>

</body>
</html>



channel.html¤Ï¡¢
https://developers.facebook.com/docs/reference/javascript/
¤Ë¤¢¤ëÄ̤ꡢ

<script src="//connect.facebook.net/en_US/all.js"></script>
¤Î°ì¹Ô¤À¤±¡£

³¤¤¤Æ¡¢FaceBook¥¢¥×¥ê¤Îcore.js¤ò¼¡¤Î¤è¤¦¤Ë½ñ¤¯¡£


// Copyright(C) Hundredsoft Corporation 2012 All rights reserved. 
//
//  FaceBook¥¢¥¯¥»¥¹¥µ¥ó¥×¥ë (javascript SDK)  core.js
//
//   2012.3 »þÅÀ¤Ç°ÕÌ£¤¬¤¢¤Ã¤Æ¡¢¤«¤ÄBasic Permission¤Ç°ú¤±¤½¤¦¤Ê¹àÌܤòʤ٤¿
//

var m_login = false;

window.fbAsyncInit = function() {
   FB.init({
      appId      : 'xxxxxxxxxxxxxxx', // App ID
      channelUrl : 'channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
   });

   // Additional initialization code here

   // Async¤Î¾ì¹ç¡¢¤¤¤¤¤Í¤ÏSDKÆɤ߹þ¤ß¸å¤Ëºî¤é¤Ê¤¤¤ÈÆüËܸì¤Ë¤Ê¤é¤Ê¤¤
   document.getElementById("iinebutton").innerHTML = '<div class="fb-like" data-href="http://www.xxxxxxxxxxx.xx.xx/" data-send="true" data-width="450" data-show-faces="true"></div>';

   FB.getLoginStatus(function(response){
      if (response.status === 'connected') {
         // Logged in
         m_login = true;
         showUser();
      }
      else{
         //ËÜÍè¤Ï¤³¤³¤ÇFB.login¤Ç¥í¥°¥¤¥óWindow¤ò½Ð¤µ¤»¤ë¡£
         //º£²ó¤Ï¥æ¡¼¥¶¤ÎÊÌÁàºî¤Ç¥í¥°¥¤¥ó¤µ¤»¤ë¤¿¤á¡¢Ìµ½èÍý¡£
      }
   });

   // ¤¤¤¤¤Í¤ò²¡¤·¤¿¤È¤­¸Æ¤Ð¤ì¤ë
   FB.Event.subscribe('edge.create', function (response) {
      if (!m_login){
         //¤Á¤ç¤Ã¤È̵Íý¤µ¤»¤Þ¤¹¡£
         FB.init({
            appId      : 'xxxxxxxxxxxxxxx', // App ID
            channelUrl : 'channel.html', // Channel File
            status     : true, // check login status
            cookie     : true, // enable cookies to allow the server to access the session
            xfbml      : true  // parse XFBML
         });

         FB.getLoginStatus(function(response){
            if (response.status === 'connected') {
               // Logged in
               m_login = true;
               showUser();
            }
         });
      }
   });
};

function showUser(){
   FB.api('/me', function(response){
      //ÆüËܸì̾¾Î¤Ï,user¥Æ¡¼¥Ö¥ë¤Ç¤Ï¤Ê¤¯,profile¡£¤·¤«¤·¸¢¸ÂÄɲä¬É¬Íס£
      document.getElementById("username").innerHTML = '<h2>¤è¤¦¤³¤½¡§' + response.name + ' ¤µ¤ó</h2>';

      var query = FB.Data.query('select uid, name, profile_url, sex, email, current_location, hometown_location, work_history, education_history, hs_info, pic_small from user where uid={0}', response.id);
      query.wait(function(rows) {
         var name_e = (rows[0].name!= undefined ?        rows[0].name : "");
         var url =    (rows[0].profile_url!= undefined ? rows[0].profile_url : "");
         var email =  (rows[0].email!= undefined ?       rows[0].email : "");
         var pic_e =  (rows[0].pic_small!= undefined ?   rows[0].pic_small : "");

         var current_loc = "";
         if (rows[0].current_location!= undefined){
             current_loc = (rows[0].current_location.city!= undefined ? rows[0].current_location.city : "") + "," +
                           (rows[0].current_location.state!= undefined ? rows[0].current_location.state : "") + "," +
                           (rows[0].current_location.country!= undefined ? rows[0].current_location.country : "");
         }
         var hometown = "";
         if (rows[0].hometown_location!= undefined){
             hometown = (rows[0].hometown_location.city!= undefined ? rows[0].hometown_location.city : "") + "," +
                        (rows[0].hometown_location.state!= undefined ? rows[0].hometown_location.state : "") + "," +
                        (rows[0].hometown_location.country!= undefined ? rows[0].hometown_location.country : "");
         }
         var highsc = "";
         if (rows[0].hs_info!= undefined){
             highsc = (rows[0].hs_info.hs1_name!= undefined ? rows[0].hs_info.hs1_name : "");
         }
         var edname = "";
         if (rows[0].education_history!= undefined){
             if (rows[0].education_history[0]!= undefined){
                edname = (rows[0].education_history[0].name!= undefined ? rows[0].education_history[0].name : "");
             }
         }
         var wkname = "";
         if (rows[0].work_history!= undefined){
             if (rows[0].work_history[0]!= undefined){
                wkname = (rows[0].work_history[0].company_name!= undefined ? rows[0].work_history[0].company_name : "");
             }
         }

         var jsex = "";
         if (rows[0].sex!= undefined){
            if (rows[0].sex == "female"){
               jsex = "½÷À­";
            }else{
               jsex = "ÃËÀ­";
            }
         }
         document.getElementById('userinf').innerHTML =  
            '̾Á°: '   +  name_e                                                    + "<br />" +
            'À­ÊÌ: '   +  jsex                                                      + "<br />" +
            'URL : '   +  '<a href="' + url + '" target="_blank">' + url + '</a>'   + "<br />" +
            'Mail: '   +  (email!= undefined ? email : "")                          + "<br />" +
            '½»½ê: '   +  current_loc                                               + "<br />" +
            'ÅļË: '   +  hometown                                                  + "<br />" +
            '²ñ¼Ò: '   +  wkname                                                    + "<br />" +
            'Âç³Ø: '   +  edname                                                    + "<br />" +
            '¹â¹»: '   +  highsc                                                    + "<br />" +
               '<img src="' +  pic_e + '" width="50" />' + "<br /><br /><br />";
      });

      showFriend();
   });
}


function showFriend(){
   FB.api('/me/friends', function(response){
      var users = "";
      var i;
      for(i=0;i<response.data.length;i++){
         var f_id = (response.data[i].id!= undefined ?   response.data[i].id : "");
         var f_name = (response.data[i].name!= undefined ?   response.data[i].name : "");
         users = users + '<a href="http://www.facebook.com/profile.php?id=' + f_id + '" target="_blank"><img src="http://graph.facebook.com/' + f_id + '/picture" width="50" />' + f_name + '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
      }
      document.getElementById("friendinfo").innerHTML = '¸½ºß¤Îͧ¿Í¤Ï¡¢' + i + ' ¿Í¤Ç¤¹¡£<br />' + users;
   });
}

// Load the SDK Asynchronously
// ja-JP¤ËÊѤ¨¤Ê¤¤¤È,¤¤¤¤¤Í¤¬ÆüËܸì¤Ë¤Ê¤é¤Ê¤¤
//
(function(d){
   var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
   if (d.getElementById(id)) {return;}
   js = d.createElement('script'); js.id = id; js.async = true;
   js.src = "//connect.facebook.net/ja_JP/all.js";
   ref.parentNode.insertBefore(js, ref);
}(document));



¤³¤Î£³¤Ä¤Î¥Õ¥¡¥¤¥ë¤òŬÅö¤ÊHP¤ËÃÖ¤±¤Ð¡¢FaceBook¾ðÊó¤òɽ¼¨¤·¤Æ¤¯¤ì¤ë¡£

¤³¤Á¤é¤Ë¥µ¥ó¥×¥ë¤òÃÖ¤¤¤Æ¤ª¤­¤Þ¤¹¡£
IE¤À¤È¡Ö¤¤¤¤¤Í¡×¤ò²¡¤·¤Æ¥í¥°¥ª¥ó¤·¤Æ¤â¾ðÊó¤¬É½¼¨¤µ¤ì¤Ê¤¤¤È¤­¤¬¤¢¤ë¤Î¤Ç¡¢
¤½¤Î»þ¤Ï¥ê¥í¡¼¥É(ºÆÆɤ߹þ¤ß)¤·¤Æ¤¯¤À¤µ¤¤¡£




Tags: ¥×¥í¥°¥é¥à¥á¥â¡¡VirtualPC´ØÏ¢¡¡Windows7(x64)´ØÏ¢
author : HUNDREDSOFT | - | -

AndroidÃå¿®²»¤Î¥ë¡¼¥×ºÆÀ¸

ÀΤÎÃå¥á¥í²°¤µ¤ó¤À¤È¡¢Ãå¿®²»¤Î¥ë¡¼¥×Éôʬ¤Ë¤«¤Ê¤ê¤Î¤³¤À¤ï¤ê¤¬¤¢¤ê¡¢
·«¤êÊÖ¤·Éôʬ¤¬¥¹¥à¡¼¥º¤Ë¤Ê¤ë¤è¤¦Ä´Àá¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£
¤¤¤ï¤æ¤ë¡¢¥ë¡¼¥×ÁǺà¤È¤¤¤¦¤ä¤Ä¤Ç¤¹¡£

´û¤ËÍÍ¡¹¤Ê¥µ¥¤¥È¤Ç¾Ò²ð¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢
Android·ÈÂӤǤϡ¢MP3,wavÅù¡¢ÍÍ¡¹¤Ê²»³Ú¥Õ¥¡¥¤¥ë¤òÃå¿®²»¤ËÀßÄê¤Ç¤­¤Þ¤¹¡£
¤·¤«¤·¡¢¼«ºî¤ÎÃå¿®²»¤òÀßÄꤹ¤ë¤È¡¢£±²ó¤·¤«ºÆÀ¸¤µ¤ì¤Ê¤¤¤¿¤á¡¢
û¤¤²»À¼¤ÇÃå¿®²»¤òºîÀ®¤¹¤ë¤È¡¢£±²ó¤À¤±ºÆÀ¸¤·¤¿¸å¡¢Ìµ²»¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£

⤷¡¢Ogg¤ÇºîÀ®¤·¤¿²»À¼¥Õ¥¡¥¤¥ë¤Ç¥á¥¿¥¿¥°¡ÖANDROID_LOOP=true¡×¤òÀßÄꤷ¤¿¾ì¹ç¤Ï¥ë¡¼¥×ºÆÀ¸¤¬²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£

¤â¤Á¤í¤óAudacityÅù¤ÇOgg¤òºîÀ®¤·¤Æ¤¤¤ì¤Ð¡¢¥á¥¿¥¿¥°ÊÔ½¸¤ÇÆþ¤ì¤é¤ì¤Þ¤¹¤¬¡¢
²»³ÚÊÔ½¸¤Ë¾¤Î¥½¥Õ¥È¤ò»È¤Ã¤Æ¤¤¤¿¤ê¤¹¤ë¤È¡¢ÌÌÅݤǤ¹¡£
³«È¯¤ò»ß¤á¤Æ¤¤¤¿wav2mld¤Ç¤â´Êñ¤ËÄɲäǤ­¤½¤¦¤Ê¤Î¤Ç¡¢ÊýË¡¤ò¹Í¤¨¤Æ¤ß¤Þ¤·¤¿¡£

PC¤Ç¤Î¥×¥í¥°¥é¥à¤È¤·¤Æ¤Ï¡¢OggVorbisɸ½à¤Î http://xiph.org ¤Î¤â¤Î¤ò»È¤Ã¤¿¤È¤·¤Æ
libvorbis-1.x.x\lib\info.c ¤Î vorbis_comment_add_tag¤òCall¤¹¤ì¤ÐÎɤ¤¡£

Î㤨¤Ð¡¢encoder_example.c ¤Ç¤¢¤ì¤Ð¡¢

vorbis_comment_init(&vc);
vorbis_comment_add_tag(&vc,"ENCODER","encoder_example.c");
¤Î¸å¤Ë¡¢
vorbis_comment_add_tag(&vc, "ANDROID_LOOP", "true");
¤òÆþ¤ì¤ì¤Ð¡¢AndroidÍѥ롼¥×²»À¼¤¬ºîÀ®¤Ç¤­¤Þ¤¹¡£

ºîÀ®¤·¤¿ogg¥Õ¥¡¥¤¥ë¤Ï¡¢¤É¤³¤«¤ËUpLoad¤·¤Æ¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤âÎɤ¤¤·¡¢
Wi-Fi ¤¬»È¤¨¤ë´Ä¶­¤Ê¤é¡¢Es explorer¤Ê¤É¤ÇPC¤«¤éľÀÜ¥³¥Ô¡¼¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
¥³¥Ô¡¼½ÐÎϾì½ê¤Ï¡¢
/sdcard/media/audio/ringtones
¤Ç¤¹¡£

wav2mld Ver.2.35 ¤Çµ¡Ç½Äɲä·¤Þ¤·¤¿¡£
¤³¤ì¤Ç¡¢¼«ºîÃå¿®²»¤¬Android·ÈÂÓ¾å¤Ç¥ë¡¼¥×ºÆÀ¸¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£


Tags: ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -

¥Ë¥å¡¼¥È¥óË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤ÎÀ°¿ô½ü»»(¤½¤Î£²)

Á°²ó¡¢½ü»» x = p / q¡¡¤òNewtonË¡¤ò»È¤Ã¤Æ²ò¤¯¥×¥í¥°¥é¥à¤ò¾Ò²ð¤·¤Þ¤·¤¿¤¬¡¢
ñÆȤνé´üÃͤò»È¤Ã¤¿ÊýË¡¤Ç¤Ï¡¢¤¢¤Þ¤êÁ᤯¤¢¤ê¤Þ¤»¤ó¡£
¿ôËübit¤òĶ¤¨¤ë¿·å±é»»¤Î¾ì¹ç¡¢64bitÀºÅ٤νé´üÃͤò»È¤Ã¤¿¤È¤·¤Æ¤â¡¢¤¢¤Þ¤ê®Å٤˺¹¤¬½Ð¤Þ¤»¤ó¡£
¤½¤³¤ÇÂ礭¤Ê·å(¿ôËübit¤òĶ¤¨¤ë)¤Ç·×»»¤ò³«»Ï¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢½ü¿ô(q)¤ÎÀèƬÉôʬ¤ò»È¤Ã¤¿¾®¤µ¤Ê·å¤Ç·×»»¤ò³«»Ï¤·¤Æ¡¢¤³¤ì¤òNewtonË¡¤Î½é´üÃͤȤ·¡¢¤â¤¦¾¯¤·Â礭¤Ê·å¤ÇNewtonË¡¤ò²ò¤¯¡¢
¤³¤ì¤ò·«¤êÊÖ¤·¤ÆºÇ½ªÅª¤ÊÅú¤¨¤òÆÀ¤ëÊýË¡¤ò¾Ò²ð¤·¤Þ¤¹¡£
¾¯¤·¥³¡¼¥É½¤Àµ¤·¤Þ¤·¤¿(2011.2.11)

Bigint newtondiv(const Bigint& q, const int& n, const Bigint& init){
  Bigint x(init), m(0), c2(2);
  c2 <<= n;
  while(m != x){
    m = x;
    x *= c2 - q * x;
    x >>= n;
  }
  return x;
}

Bigint iDiv(Bigint p, Bigint q){
  int pb = p.length(); // Èï½ü¿ô¤Îbit¿ô
  int qb = q.length(); // ½ü¿ô¤Îbit¿ô
  int n;
  int b = 64;
  int step = qb / 4;

  Bigint d = 1;
  d <<= b;      // NewtonË¡¤Î½é´üÃͤȤ·¤Æ, 1 << b ¤òÍ¿¤¨¤ë¡£

  d = newtondiv(q >> (qb-b), b*2, d);  // 1²óÌÜ
  b += step;
  d <<= step;

  d = newtondiv(q >> (qb-b), b*2, d);  // 2²óÌÜ
  b += step;
  d <<= step;

  d = newtondiv(q >> (qb-b), b*2, d);  // 3²óÌÜ
  d <<= (pb-b);
  n = pb + qb;

  d = newtondiv(q, n, d);  // 4²óÌÜ

  d *= p;        // d = p / q
  d >>= n;

  // ¸íº¹½¤Àµ
  if (p >= (d+1)*q){
      d += 1;
  }
  return d;
}


newtondiv¤Ï¡¢NewtonË¡¤Ç ¡Ê2n / q¡Ë ¤òµá¤á¤ë´Ø¿ô¤Ç¤¹¡£
½é²ó¤ÏÀèƬ64bitÄøÅ٤Ƿ׻»¤·¤Þ¤¹¡£
2²óÌܤϡ¢½é²ó¤Î·×»»·ë²Ì¤ò½é´üÃͤȤ·¤Æ¡¢64+(½ü¿ô¤ÎBit¿ô/4)¤Ç¤Î·×»»¡£
3²óÌܤϡ¢£²²óÌܤη׻»·ë²Ì¤ò½é´üÃͤȤ·¤Æ¡¢64+(½ü¿ô¤ÎBit¿ô/2)¤Ç¤Î·×»»¡£
4²óÌܤϡ¢£³²óÌܤη׻»·ë²Ì¤ò½é´üÃͤȤ·¤Æ¡¢Á´·å¤Ç¤Î·×»»¡£
¤È·×»»·å¤òÁý¤ä¤·¤Æ¤¤¤­¤Þ¤¹¡£

½ü¿ô¡¦Èï½ü¿ô¤Î¤È¤êÊý¤Ë¤â¤è¤ê¤Þ¤¹¤¬¡¢·×»»»þ´Ö¤ÏÌÀ¤é¤«¤Ëû¤¯¤Ê¤ê¤Þ¤¹¡£
¤³¤ÎÊýË¡¤Ï¡¢Bigint¤Î±é»»²ó¿ô¤È¤·¤Æ¤Ï¡¢¸ú²Ì¤Ï¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢
²ÄÊÑŤÎFFT¾è»»¤òÍѤ¤¤ë¾ì¹ç¡¢±é»»Î̤ϣ²¤ÎÑÑ¿ô·åñ°Ì¤ËÁý²Ã¤¹¤ë¤Î¤Ç¡¢
Total¤Î·×»»Î̤Ȥ·¤Æ¤Ï¡¢¤³¤Á¤é¤ÎÊý¤¬Í­Íø¤Ç¤¹¡£

4ʬ³ä¤È¤·¤Æ¤¤¤Þ¤¹¤¬¡¢ÍøÍѤ¹¤ëBigint(¿ÇÜĹÀ°¿ô)¥¯¥é¥¹¤ÇºÇ®¤È¤Ê¤ë¤è¤¦Ä´À᤹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
¤³¤ì¤Ë¤Ä¤¤¤Æ¤Ï¡¢¡Ö¹â¶¶ Âç²ð, ¶âÅÄ ¹¯Àµ. "¿ÇÜĹʿÊýº¬¤Î¹â®·×»»Ë¡". ¾ðÊó½èÍý³Ø²ñ¸¦µæÊó¹ð 95-HPC-58, pp.51-56.¡×¤¬¾Ü¤·¤¤¤Ç¤¹¡£
ʸ¸¥¤Ë½¾¤¨¤Ð¡¢½é´üÃͤËÇÜÀºÅÙ·ë²Ì¤ò»È¤¦¡¦£³¡Á£´Ê¬³äÄøÅÙ¡¦FFTºÆÍøÍÑ¡¢¤ò¹Ô¤¨¤ÐºÇÂç¸Â¤Î¹â®²½¤ò˾¤á¤Þ¤¹¤¬¡¢¤³¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ç¤Ï¤½¤³¤Þ¤ÇÂбþ¤Ç¤­¤Æ¤¤¤Þ¤»¤ó¡£

¤³¤³¤Ç¤ÏÀâÌÀ¤ò´Êñ¤Ë¤¹¤ë¤¿¤á½é´üÃͤˡÊ2^64¡Ë¤òÍ¿¤¨¤Æ¤¤¤Þ¤¹¡£
¤è¤êÀµ³Î¤Ê½é´üÃͤΤȤêÊý¤ä¡¢¾ÜºÙ¥¢¥ë¥´¥ê¥º¥à¤Ï¤³¤Á¤é
À°¿ô½ü»»¤Î¾ÜºÙ²òÀâ

½ü¿ô¡¦Èó½ü¿ô¤Î·åº¹¤¬¾®¤µ¤±¤ì¤Ð¡¢¤³¤Î¤è¤¦¤ÊÊýË¡¤â¤¢¤ê¤Þ¤¹¡£
²óÉüË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤Î½ü»»

ƱÍͤη׻»ÊýË¡¤ò¹Ô¤Ã¤Æ¤¤¤ë¡¢À°¿ôÊ¿Êýº¬²òÀâ¤Ï¤³¤Á¤é
À°¿ôÊ¿Êýº¬¤Ç¤Î¾ÜºÙ²òÀâ

¤³¤Î¥¢¥ë¥´¥ê¥º¥à¤òÍøÍѤ·¤¿16¿Ê¡¦£²¿Ê¡¦10¿ÊÅÅÂî¤Ç¤¹¡£
À°¿ô¤À¤±¤Ç¤¹¤¬¤ª¤è¤½100Ëü·å¤Þ¤Ç·×»»¤Ç¤­¤Þ¤¹¡£


(Ãí)¤³¤³¤Ç¤ÎBigint¥¯¥é¥¹¤Ï¡¢Â¿ÇÜĹÀ°¿ô¤ò³ÊǼ¤¹¤ë²¾ÁۤΥ¯¥é¥¹¤Ç¤¢¤ê¡¢¼Âºß¤¹¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£


Tags: ¥×¥í¥°¥é¥à¥á¥â
³¤­¤òÆɤà¡ä¡ä
author : HUNDREDSOFT | - | -

¥Ë¥å¡¼¥È¥óË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤ÎÀ°¿ôÊ¿Êýº¬(¤½¤Î£²)

Á°²ó¡¢Ê¿Êýº¬ ¢ås¡¡¤òNewtonË¡¤ò»È¤Ã¤Æ²ò¤¯¥×¥í¥°¥é¥à¤ò¾Ò²ð¤·¤Þ¤·¤¿¤¬¡¢
ñÆȤνé´üÃͤò»È¤Ã¤¿ÊýË¡¤Ç¤Ï¡¢¤¢¤Þ¤êÁ᤯¤¢¤ê¤Þ¤»¤ó¡£
¿ôËübit¤òĶ¤¨¤ë¿·å±é»»¤Î¾ì¹ç¡¢64bitÀºÅ٤νé´üÃͤò»È¤Ã¤¿¤È¤·¤Æ¤â¡¢¤¢¤Þ¤ê®Å٤˺¹¤¬½Ð¤Þ¤»¤ó¡£
¤½¤³¤ÇÂ礭¤Ê·å(¿ôËübit¤òĶ¤¨¤ë)¤Ç·×»»¤ò³«»Ï¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢(s)¤ÎÀèƬÉôʬ¤ò»È¤Ã¤¿¾®¤µ¤Ê·å¤Ç·×»»¤ò³«»Ï¤·¤Æ¡¢¤³¤ì¤òNewtonË¡¤Î½é´üÃͤȤ·¡¢¤â¤¦¾¯¤·Â礭¤Ê·å¤ÇNewtonË¡¤ò²ò¤¯¡¢
¤³¤ì¤ò·«¤êÊÖ¤·¤ÆºÇ½ªÅª¤ÊÅú¤¨¤òÆÀ¤ëÊýË¡¤ò¾Ò²ð¤·¤Þ¤¹¡£


Bigint newtonsqrt(const Bigint& q, const int& n, const Bigint& init){
  Bigint x(init), m(0), c3(3);
  c3 <<= n;
  while(m != x){
    m = x;
    x *= c3 - ((m * m * q) >> n);
    x >>= n+1;
  }
  return x;
}

Bigint iSqrt(Bigint s){
  int n = s.length(); // bit¿ô
  int b;
  if (n & 1)    b = 65; // ½é´ü±é»»Bit¿ô(n:´ñ¿ô)
  else          b = 64; // ½é´ü±é»»Bit¿ô(n:¶ö¿ô)

  Bigint x = 1;
  x <<= (b / 2);  // NewtonË¡¤Î½é´üÃͤȤ·¤Æ, 1 << (b/2) ¤òÍ¿¤¨¤ë¡£

  Bigint w;
  int m = n / 8;  // 4ʬ³äÄøÅÙ

  while(1){
    w = s >> (n - b);        // (s)ÀèƬ¤«¤é»ØÄêbit¿ô(n-b)ÀÚ¤ê¼è¤ê
    x = newtonsqrt(w, b, x);

    if (b + 2 * m > n)
      break;

    b += 2 * m;
    x <<= m;
  }
  x <<= (n - b) / 2;         // ɬ¤º³ä¤êÀÚ¤ì¤ë
  x = newtonsqrt(s, n, x);

  x *= s;         // x = s * (2^n) / ¢ås = (2^n) * ¢ås
  x >>= n;        // x = ¢ås

  // ¸íº¹½¤Àµ
  w = x + 1;
  if (s >= w * w){
     x = w;
  }
  return x;
}


newtonsqrt¤Ï¡¢NewtonË¡¤Ç ¡Ê2n / ¢åq¡Ë ¤òµá¤á¤ë´Ø¿ô¤Ç¤¹¡£
½é²ó¤ÏÀèƬ64bitÄøÅ٤Ƿ׻»¤·¤Þ¤¹¡£
2²óÌܤϡ¢½é²ó¤Î·×»»·ë²Ì¤ò½é´üÃͤȤ·¤Æ¡¢(n/8)·åÁý¤ä¤·¤Æ·×»»¡£
3²óÌܤϡ¢£²²óÌܤη׻»·ë²Ì¤ò½é´üÃͤȤ·¤Æ¡¢¹¹¤Ë(n/8)·åÁý¤ä¤·¤Æ·×»»¡£
¤È¼¡¡¹¤È·å¤òÁý¤ä¤·¤Æ¤¤¤­¤Þ¤¹¡£

·×»»»þ´Ö¤ÏÌÀ¤é¤«¤Ëû¤¯¤Ê¤ê¤Þ¤¹¡£
¤³¤ÎÊýË¡¤Ï¡¢Bigint¤Î±é»»²ó¿ô¤È¤·¤Æ¤Ï¡¢¸ú²Ì¤Ï¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢
²ÄÊÑŤÎFFT¾è»»¤òÍѤ¤¤ë¾ì¹ç¡¢±é»»Î̤ϣ²¤ÎÑÑ¿ô·åñ°Ì¤ËÁý²Ã¤¹¤ë¤Î¤Ç¡¢
Total¤Î·×»»Î̤Ȥ·¤Æ¤Ï¡¢¤³¤Á¤é¤ÎÊý¤¬Í­Íø¤Ç¤¹¡£

ʬ³ä¿ô¤Ï¡¢ÍøÍѤ¹¤ëBigint(¿ÇÜĹÀ°¿ô)¥¯¥é¥¹¤ÇºÇ®¤ÎÀ­Ç½¤¬½Ð¤ë¤è¤¦¤ËÄ´À᤹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
¤³¤ì¤Ë¤Ä¤¤¤Æ¤Ï¡¢¡Ö¹â¶¶ Âç²ð, ¶âÅÄ ¹¯Àµ. "¿ÇÜĹʿÊýº¬¤Î¹â®·×»»Ë¡". ¾ðÊó½èÍý³Ø²ñ¸¦µæÊó¹ð 95-HPC-58, pp.51-56.¡×¤¬¾Ü¤·¤¤¤Ç¤¹¡£
ʸ¸¥¤Ë½¾¤¨¤Ð¡¢½é´üÃͤËÇÜÀºÅÙ·ë²Ì¤ò»È¤¦¡¦£³¡Á£´Ê¬³äÄøÅÙ¡¦FFTºÆÍøÍÑ¡¢¤ò¹Ô¤¨¤ÐºÇÂç¸Â¤Î¹â®²½¤ò˾¤á¤Þ¤¹¤¬¡¢¤³¤Î¥µ¥ó¥×¥ë¥³¡¼¥É¤Ç¤Ï¤½¤³¤Þ¤ÇÂбþ¤Ç¤­¤Æ¤¤¤Þ¤»¤ó¡£

¤Þ¤¿¡¢¤³¤ÎÊýË¡¤ÏÊ¿Êýº¬¤Ë¸Â¤é¤º¡¢NewtonË¡¤ò»È¤Ã¤¿ÍÍ¡¹¤Ê·×»»¤Ë±þÍѤǤ­¤Þ¤¹¡£

À°¿ôÊ¿Êýº¬¤Ç¤Î¾ÜºÙ²òÀâ

À°¿ô½ü»»¤Ç¤Î¾ÜºÙ²òÀâ

¤³¤Î¥¢¥ë¥´¥ê¥º¥à¤òÍøÍѤ·¤¿16¿Ê¡¦£²¿Ê¡¦10¿ÊÅÅÂî¤Ç¤¹¡£
À°¿ô¤À¤±¤Ç¤¹¤¬¤ª¤è¤½100Ëü·å¤Þ¤Ç·×»»¤Ç¤­¤Þ¤¹¡£


(Ãí)¤³¤³¤Ç¤ÎBigint¥¯¥é¥¹¤Ï¡¢Â¿ÇÜĹÀ°¿ô¤ò³ÊǼ¤¹¤ë²¾ÁۤΥ¯¥é¥¹¤Ç¤¢¤ê¡¢¼Âºß¤¹¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£


Tags: ¥×¥í¥°¥é¥à¥á¥â
³¤­¤òÆɤà¡ä¡ä
author : HUNDREDSOFT | - | -

¥â¥ó¥´¥á¥êÑѾê; ¥µ¥ó¥×¥ë¥³¡¼¥É

Á°²ó¡¢¥â¥ó¥´¥á¥ê¾è»» ¥µ¥ó¥×¥ë¥³¡¼¥É¤ò½ñ¤­¤Þ¤·¤¿¤¬¡¢¤è¤¯»È¤ï¤ì¤ëÑѾê;¤Ë¤Ä¤¤¤Æ¤âC++¥µ¥ó¥×¥ë¤òºÜ¤»¤Æ¤ª¤­¤Þ¤¹¡£


// ¥â¥ó¥´¥á¥êÑѾê;±é»» (a^b) mod n¤òµá¤á¤ë
// gcd(n,r) == 1 ¤È¤Ê¤ë¤³¤È¡£(n¤Ï´ñ¿ô¤Ç¤¢¤ì¤ÐÎɤ¤)
//
#ifndef MONTGOMERY_INCLUDED
#define MONTGOMERY_INCLUDED

#include "Bigint.h"

class montgomery{
public:
    montgomery(const Bigint& n) : m_n(), m_r2(), m_nb(0), m_n2(){
        m_n = n;
        // n ¤òË¡¤È¤¹¤ë
        // BitŤòÄ´¤Ù¤ë(nb)
        m_nb = n.length();

        // r: n¤è¤êÂ礭¤Ê£²¤Î¤Ù¤­
        Bigint r(1);
        r <<= m_nb;

        // r2 = r^2 mod n
        m_r2 = r * r;
        m_r2 %= n;

        // n*n2 ¢á -1 mod r
        m_n2 = 0; /* µá¤á¤ëN' */
        Bigint t = 0;
        Bigint vi = 1;
        int ni = m_nb;
        while (ni--){ /* R¤Î¥È¥Ã¥×¥Ó¥Ã¥È¤ò½ü¤¤¤¿¥Ó¥Ã¥È¿ôʬ·«¤êÊÖ¤¹ */
            if ((t & 1) == 0){
                /* ¥¼¥í¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥Ó¥Ã¥È¤¬¤¢¤Ã¤¿¤é¡¢N'¤Î¤½¤ÎÉôʬ¤ò1¤Ë¤¹¤ë¡ÊN¤ÏR¤È¸ß¤¤¤ËÁǤʤΤÇɬ¤º´ñ¿ô¡Ë*/
                t += n; /* ³Ý¤±»»¤À¤¬¡¢Æó¿Ê¿ô°ì·å¤Î³Ý¤±»»¤Ê¤Î¤Ç¼Â¼Á¤Ï­¤·»» */
                m_n2 += vi; /* N'¤Î¤½¤ÎÉôʬ¤ò1¤Ë¤¹¤ë */
            }
            t >>= 1; /* ɬ¤ºÃ¼¿ô¤¬½Ð¤ë¤¬ÀÚ¤ê¼Î¤Æ¤ë */
            vi <<= 1; /* R¤Ï2¤ÎÑѤʤΤǡ¢ÀäÂÐü¿ô¤Ï½Ð¤Ê¤¤ */
        }
    }

    ~montgomery(){}

    Bigint reduction(const Bigint& t){
        // t¤Î¥â¥ó¥´¥á¥ê¥ê¥À¥¯¥·¥ç¥ó
        Bigint c = t * m_n2;
        c.hibitmask(m_nb); // mod R¤Î°ÕÌ£,(m_nb)bit°Ê¾å¤ò0¥¯¥ê¥¢
        c *= m_n;
        c += t;
        c >>= m_nb; // 1/r ¤Î°ÕÌ£
        if (c >= m_n) c -= m_n;
        return c;
    }

    // ÑѾê; a^b mod n, ¥Ð¥¤¥Ê¥êË¡¤Î²¼°Ì·å¤«¤é·×»»
    Bigint exp(const Bigint& a, const Bigint& b){
        Bigint p = reduction(a * m_r2);
        Bigint x = reduction(m_r2);
        Bigint y(b);
        while (y > 0){
            if (y & 1){
                x = reduction(x * p);
            }
            p = reduction(p * p);
            y >>= 1;
        }
        return reduction(x);
    }

protected:
    montgomery() : m_n(), m_r2(), m_nb(0), m_n2(){}

private:
    Bigint m_n;   // Ë¡(m_n)
    Bigint m_r2;  // r¤ò(m_n)¤è¤êÂ礭¤Ê£²¤Î¤Ù¤­¤È¤·¤Æ¡¢(m_r2)=(r)^2 mod n
    Bigint m_n2;  // (m_n)*(m_n2) ¢á -1 mod r ¤òËþ¤¿¤¹(m_n2)
    int    m_nb;  // (m_n)¤ÎÍ­¸úBit¿ô, Î㤨¤Ð(m_n)=5 ¤Î¤È¤­(m_nb)=3
};

#endif



wikipedia¤ÎÀâÌÀ¤Ë¤¢¤ë¤è¤¦¤Ë¥Ð¥¤¥Ê¥êË¡¤òÍѤ¤¤Æ¤¤¤Þ¤¹¡£
½é¤á¤ËË¡(n)¤È¤¹¤ë¥³¥ó¥¹¥È¥é¥¯¥¿¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£
ÑѾê;¤Ï¡¢exp()¥á¥½¥Ã¥É¤Ç¹Ô¤¤¤Þ¤¹¡£


¤³¤Î¥¢¥ë¥´¥ê¥º¥à¤òÍøÍѤ·¤¿16¿Ê¡¦£²¿Ê¡¦10¿ÊÅÅÂî¤Ç¤¹¡£
À°¿ô¤À¤±¤Ç¤¹¤¬¤ª¤è¤½100Ëü·å¤Þ¤Ç·×»»¤Ç¤­¤Þ¤¹¡£


(Ãí)Bigint¥¯¥é¥¹¤Ï¡¢Â¿ÇÜĹÀ°¿ô¤ò³ÊǼ¤¹¤ë²¾ÁۤΥ¯¥é¥¹¤Ç¤¢¤ê¡¢¼Âºß¤¹¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£


Tags: ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -

VC++¤Ç³ÈÄ¥ÇÜÀºÅÙ¤ò¤É¤¦¤·¤Æ¤â»È¤¤¤¿¤¤

VC++¤Ç³ÈÄ¥ÇÜÀºÅÙÉâÆ°¾®¿ôÅÀ·Á¼°¤ò¤É¤¦¤·¤Æ¤â»È¤¤¤¿¤¤

Visual Stdio¤Ç¤Ï³ÈÄ¥ÇÜÀºÅÙÉâÆ°¾®¿ô(80bit)¤¬»È¤¨¤Þ¤»¤ó¡£
long double ¤È½ñ¤¤¤Æ¤â¡¢64bitÀºÅ٤ˤʤê¤Þ¤¹¡£
Ä̾²¾¿ôÉô53bit(°ÅÌÛBit´Þ¤á)¤ÇÉÔ­¤¹¤ë¤³¤È¤Ï¤Ê¤¤¤Ç¤·¤ç¤¦¤¬¡¢
¤É¤¦¤·¤Æ¤â²¾¿ôÉô64bit¤¬É¬ÍפȤ¤¤¦¾ì¹ç¤Î¥µ¥ó¥×¥ë¥¯¥é¥¹¤Ç¤¹¡£
ÍÍ¡¹¤Ê¥³¥ó¥¹¥È¥é¥¯¥¿¡¢»Í§±é»»¡¦Èæ³Ó¤Î¾¡¢FPU¤Ç¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë»°³Ñ´Ø¿ô¤äÊ¿Êýº¬¤òÆþ¤ì¤Þ¤·¤¿¡£


/* (c) Hundredsoft Corporation 2010 All rights reserved.

	Ldouble.h -  VC ³ÈÄ¥ÇÜÀºÅÙ¥¯¥é¥¹

*/

#ifndef LDOUBLE_INCLUDED
#define LDOUBLE_INCLUDED

#include <memory.h>

typedef struct {
	unsigned char d[12];
} LONG_DOUBLE_STR, *LPLONG_DOUBLE_STR;

void Ldouble_init()
{
	unsigned short fcw=0x033f;	// round to nearest, 64 bits, exceptions disabled
	__asm {
		fldcw     [fcw]
	}
}

class Ldouble
{
public:
	Ldouble() {
		memset(&m_data, 0, sizeof(m_data));
	}
	virtual ~Ldouble(){}

	Ldouble(const Ldouble& v) {
		if (this != &v){
			memcpy(&m_data, &v.m_data, sizeof(m_data));
		}
	}
	Ldouble(const __int64& v) {
		LPLONG_DOUBLE_STR m = &m_data;
		__asm {
			mov  eax, [v]
			fild qword ptr [eax]
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
	}
	Ldouble(const unsigned __int64& v) {
		__int64 t = 0x8000000000000000;
		int i;
		for (i=63; i>=0; i--, t>>=1){
			if (v & t) break;
		}
		if (i < 0){
			memset(&m_data, 0, sizeof(m_data));
		}else{
			t = v;
			t <<= 63-i; // ²¾¿ôÉô
			int ex = i + 16383; // »Ø¿ôÉô
			memcpy(&m_data, &t, sizeof(__int64));
			*(int*)&m_data.d[8] = ex;
		}
	}
	Ldouble(const int& v) {
		LPLONG_DOUBLE_STR m = &m_data;
		__asm {
			mov  eax, [v]
			fild dword ptr [eax]
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
	}
	Ldouble(const unsigned int& v) {
		__int64 i = v;
		LPLONG_DOUBLE_STR m = &m_data;
		__asm {
			lea  eax, [i]
			fild qword ptr [eax]
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
	}
	Ldouble(const short& v) {
		LPLONG_DOUBLE_STR m = &m_data;
		int i = v;
		__asm {
			lea  eax, [i]
			fild dword ptr [eax]
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
	}
	Ldouble(const unsigned short& v) {
		LPLONG_DOUBLE_STR m = &m_data;
		int i = v;
		__asm {
			lea  eax, [i]
			fild dword ptr [eax]
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
	}
	Ldouble(const char& v) {
		LPLONG_DOUBLE_STR m = &m_data;
		int i = v;
		__asm {
			lea  eax, [i]
			fild dword ptr [eax]
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
	}
	Ldouble(const unsigned char& v) {
		LPLONG_DOUBLE_STR m = &m_data;
		int i = v;
		__asm {
			lea  eax, [i]
			fild dword ptr [eax]
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
	}
	Ldouble(const double& v) {
		LPLONG_DOUBLE_STR m = &m_data;
		__asm {
			mov  eax, [v]
			fld  qword ptr [eax]
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
	}
	Ldouble& operator=(const Ldouble& v){
		if (this != &v){
			memcpy(&m_data, &v.m_data, sizeof(m_data));
		}
		return *this;
	}

	// Unary -								
	Ldouble operator-(){
		Ldouble v = *this;
		v.m_data.d[9] ^= 0x80;
		return v;
	}
	Ldouble operator++(){
		LPLONG_DOUBLE_STR m = &m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fld1
			fadd
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
		return *this;
	}
	Ldouble operator++(int){
		Ldouble v = *this;
		LPLONG_DOUBLE_STR m = &m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fld1
			fadd
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
		return v;
	}
	Ldouble operator--(){
		LPLONG_DOUBLE_STR m = &m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fld1
			fsub
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
		return *this;
	}
	Ldouble operator--(int){
		Ldouble v = *this;
		LPLONG_DOUBLE_STR m = &m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fld1
			fsub
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
		return v;
	}

	// Binary operator +=, -=, *=, /=
	Ldouble& operator+=(const Ldouble& v){
		LPLONG_DOUBLE_STR m = &m_data;
		LPLONG_DOUBLE_STR mv = (LPLONG_DOUBLE_STR)&v.m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			mov  eax, [mv]
			fld  tbyte ptr [eax]
			fadd
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
		return *this;
	}
	Ldouble& operator-=(const Ldouble& v){
		LPLONG_DOUBLE_STR m = &m_data;
		LPLONG_DOUBLE_STR mv = (LPLONG_DOUBLE_STR)&v.m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			mov  eax, [mv]
			fld  tbyte ptr [eax]
			fsub
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
		return *this;
	}
	Ldouble& operator*=(const Ldouble& v){
		LPLONG_DOUBLE_STR m = &m_data;
		LPLONG_DOUBLE_STR mv = (LPLONG_DOUBLE_STR)&v.m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			mov  eax, [mv]
			fld  tbyte ptr [eax]
			fmul
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
		return *this;
	}
	Ldouble& operator/=(const Ldouble& v){
		LPLONG_DOUBLE_STR m = &m_data;
		LPLONG_DOUBLE_STR mv = (LPLONG_DOUBLE_STR)&v.m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			mov  eax, [mv]
			fld  tbyte ptr [eax]
			fdiv
			mov  eax, [m]
			fstp tbyte ptr [eax]
		}
		return *this;
	}

	// compare
	// this <  v: -
	// this == v: 0
	// this >  v: +
	int comp(const Ldouble& v) const{
		LPLONG_DOUBLE_STR m = (LPLONG_DOUBLE_STR)&m_data;
		LPLONG_DOUBLE_STR mv = (LPLONG_DOUBLE_STR)&v.m_data;
		short sts;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			mov  eax, [mv]
			fld  tbyte ptr [eax]
			lea  eax, [sts]
			fcompp
			fnstsw word ptr [eax]
		}
		return ((sts & 0x4100) - 1) ^ 0x3fff;
	}
	bool operator==(const Ldouble& v) const{
		return (comp(v) == 0);
	}
	bool operator!=(const Ldouble& v) const{
		return (comp(v) != 0);
	}
	bool operator<(const Ldouble& v) const{
		return (comp(v) < 0);
	}
	bool operator<=(const Ldouble& v) const{
		return (comp(v) <= 0);
	}
	bool operator>(const Ldouble& v) const{
		return (comp(v) > 0);
	}
	bool operator>=(const Ldouble& v) const{
		return (comp(v) >= 0);
	}

	// cast
	operator double() {
		LPLONG_DOUBLE_STR m = (LPLONG_DOUBLE_STR)&m_data;
		double t;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fstp qword ptr [t]
		}
		return t;
	}
	operator int() {
		LPLONG_DOUBLE_STR m = (LPLONG_DOUBLE_STR)&m_data;
		double t;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fstp qword ptr [t]
		}
		return (int)t;
	}

	//friend Binary operator	 +,-,*,/
	friend  const Ldouble operator+(const  Ldouble&a, const Ldouble&b){
		Ldouble p(a);
		p += b;
		return p;
	}
	friend  const Ldouble operator-(const  Ldouble&a, const Ldouble&b){
		Ldouble p(a);
		p -= b;
		return p;
	}
	friend  const Ldouble operator*(const  Ldouble&a, const Ldouble&b){
		Ldouble p(a);
		p *= b;
		return p;
	}
	friend  const Ldouble operator/(const  Ldouble&a, const Ldouble&b){
		Ldouble p(a);
		p /= b;
		return p;
	}


	LONG_DOUBLE_STR	m_data;
};

namespace LD {
	Ldouble abs(const Ldouble& s){
		Ldouble v(s);
		v.m_data.d[9] &= 0x7f;
		return v;
	}

	Ldouble sin(const Ldouble& s){
		Ldouble v(s);
		LPLONG_DOUBLE_STR m = &v.m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fsin
			fstp tbyte ptr [eax]
		}
		return v;
	}

	Ldouble cos(const Ldouble& s){
		Ldouble v(s);
		LPLONG_DOUBLE_STR m = &v.m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fcos
			fstp tbyte ptr [eax]
		}
		return v;
	}

	Ldouble tan(const Ldouble& s){
		Ldouble v(s);
		double t;
		LPLONG_DOUBLE_STR m = &v.m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fptan
			lea  ebx, [t]
			fstp qword ptr [ebx]
			fstp tbyte ptr [eax]
		}
		return v;
	}

	Ldouble atan(const Ldouble& s){
		Ldouble v(s);
		LPLONG_DOUBLE_STR m = &v.m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fld1
			fpatan
			fstp tbyte ptr [eax]
		}
		return v;
	}

	Ldouble atan2(const Ldouble& x, const Ldouble& y){
		Ldouble v(y);
		LPLONG_DOUBLE_STR xm = (LPLONG_DOUBLE_STR)&x.m_data;
		LPLONG_DOUBLE_STR vm = &v.m_data;
		__asm {
			mov  eax, [xm]
			fld  tbyte ptr [eax]
			mov  eax, [vm]
			fld  tbyte ptr [eax]
			fpatan
			fstp tbyte ptr [eax]
		}
		return v;
	}

	Ldouble sqrt(const Ldouble& s){
		Ldouble v(s);
		LPLONG_DOUBLE_STR m = &v.m_data;
		__asm {
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fsqrt
			fstp tbyte ptr [eax]
		}
		return v;
	}

	Ldouble pi(){
		Ldouble v;
		LPLONG_DOUBLE_STR m = &v.m_data;
		__asm {
			mov  eax, [m]
			fldpi
			fstp tbyte ptr [eax]
		}
		return v;
	}

	Ldouble log(const Ldouble& s){
		Ldouble v(s);
		LPLONG_DOUBLE_STR m = &v.m_data;
		__asm {
			fldln2
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fyl2x
			fstp tbyte ptr [eax]
		}
		return v;
	}

	Ldouble log10(const Ldouble& s){
		Ldouble v(s);
		LPLONG_DOUBLE_STR m = &v.m_data;
		__asm {
			fldlg2
			mov  eax, [m]
			fld  tbyte ptr [eax]
			fyl2x
			fstp tbyte ptr [eax]
		}
		return v;
	}

	Ldouble exp(const Ldouble& s){
		Ldouble v(s);
		LPLONG_DOUBLE_STR m = &v.m_data;
		double half = 0.5;
		bool sign = ((m->d[9] & 0x80) != 0);
		m->d[9] &= 0x7f;

		__asm {
			fldl2e                 // log2e
			mov  eax, [m]
			fld  tbyte ptr [eax]   // log2e, v
			fmul                   // log2e*v
			fld  st(0)             // log2e*v, log2e*v
			lea  ebx, [half]
			fld  qword ptr [ebx]   // log2e*v, log2e*v, 0.5
			fsub                   // log2e*v, log2e*v-0.5
			frndint                // log2e*v, (int)(log2e*v-0.5)
			fxch                   // (int)(log2e*v-0.5), log2e*v
			fsub  st(0), st(1)     // (int)(log2e*v-0.5), log2e*v - (int)(log2e*v-0.5)
			f2xm1                  // (int)(log2e*v-0.5), 2^(log2e*v - (int)(log2e*v-0.5))-1
			fld1                   // (int)(log2e*v-0.5), 2^(log2e*v - (int)(log2e*v-0.5))-1, 1
			fadd                   // (int)(log2e*v-0.5), 2^(log2e*v - (int)(log2e*v-0.5))
			fscale                 // (int)(log2e*v-0.5), 2^(log2e*v - (int)(log2e*v-0.5)) * 2^(int)(log2e*v-0.5)
			fstp tbyte ptr [eax]   // (int)(log2e*v-0.5)
			fstp qword ptr [ebx]   // 
		}

		if (sign){
			__asm {
				fld1
				mov  eax, [m]
				fld  tbyte ptr [eax]
				fdiv
				fstp tbyte ptr [eax]
			}
		}
		return v;
	}

	Ldouble pow(const Ldouble& x, const Ldouble& y){
		Ldouble u(x),v(y);
		LPLONG_DOUBLE_STR mx = &u.m_data;
		LPLONG_DOUBLE_STR m = &v.m_data;
		double half = 0.5;
		bool xsign = ((mx->d[9] & 0x80) != 0);
		bool ysign = ((m->d[9] & 0x80) != 0);
		if (xsign){
			int ny = (int)v;
			Ldouble t = ny;
			if (t != y){
				throw "Invalid value.";
			}
			xsign = (ny & 1) ? true : false;
		}
		mx->d[9] &= 0x7f;
		m->d[9] &= 0x7f;

		__asm {
			fld1                   // 1
			mov  eax, [mx]
			fld  tbyte ptr [eax]   // 1, x
			fyl2x                  // log2x
			mov  eax, [m]
			fld  tbyte ptr [eax]   // log2x, v
			fmul                   // log2x*v
			fld  st(0)             // log2x*v, log2x*v
			lea  ebx, [half]
			fld  qword ptr [ebx]   // log2x*v, log2x*v, 0.5
			fsub                   // log2x*v, log2x*v-0.5
			frndint                // log2x*v, (int)(log2x*v-0.5)
			fxch                   // (int)(log2x*v-0.5), log2x*v
			fsub  st(0), st(1)     // (int)(log2x*v-0.5), log2x*v - (int)(log2x*v-0.5)
			f2xm1                  // (int)(log2x*v-0.5), 2^(log2x*v - (int)(log2x*v-0.5))-1
			fld1                   // (int)(log2x*v-0.5), 2^(log2x*v - (int)(log2x*v-0.5))-1, 1
			fadd                   // (int)(log2x*v-0.5), 2^(log2x*v - (int)(log2x*v-0.5))
			fscale                 // (int)(log2x*v-0.5), 2^(log2x*v - (int)(log2x*v-0.5)) * 2^(int)(log2x*v-0.5)
			fstp tbyte ptr [eax]   // (int)(log2x*v-0.5)
			fstp qword ptr [ebx]   // 
		}

		if (ysign){
			__asm {
				fld1
				mov  eax, [m]
				fld  tbyte ptr [eax]
				fdiv
				fstp tbyte ptr [eax]
			}
		}
		if (xsign){
			m->d[9] |= 0x80;
		}
		return v;
	}
} // end of namespace

#endif

Ldouble¥¯¥é¥¹¤ò»È¤¦Á°¤Ë¡¢Ldouble_init()¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢FPU¤Ë³ÈÄ¥ÇÜÀºÅÙ¤ò»Ø¼¨¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
¤³¤Î¥³¡¼¥É¤ÏÆ°ºî¤·¤Þ¤¹¤¬¡¢¤¢¤Þ¤ê®¤¯¤¢¤ê¤Þ¤»¤ó¡£
¼Â¹Ô®Å٤ˤĤ¤¤Æ¤Ï¥³¥ó¥Ñ¥¤¥é¤¬³ÈÄ¥ÇÜÀºÅÙ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¯¤ì¤Ê¤¤¤È¡¢¤É¤¦¤Ë¤â¤Ê¤ê¤Þ¤»¤ó¡£
¼Â¹Ô®ÅÙ¤ò¤½¤ì¤Û¤Éµá¤á¤Æ¤¤¤Ê¤¤¤¬¡¢²¾¿ôÉô64bit¤ÎÀºÅÙ¤¬É¬ÍפǤ¢¤ë¤«¡¢
ºÇÂçÃͤ¬10¿Ê¤Ç300·å°Ê¾å¤Ë¤Ê¤ë¾ì¹ç¡Ê³ÈÄ¥ÇÜÀºÅ٤ǤϤª¤è¤½5000·å¤Þ¤Ç²Äǽ¡Ë¤Ë¤Î¤ßÍ­¸ú¤Ç¤¹¡£
Win32¥¢¥×¥ê¤Ç³ÈÄ¥ÇÜÀºÅÙ·×»»¤ò¹Ô¤¤¡¢Æ±»þ¤Ë¼Â¹Ô®ÅÙ¤âµá¤á¤ë¤Ê¤é¡¢VC°Ê³°¤Î¥³¥ó¥Ñ¥¤¥é(C++ BuilderÅù)¤òÍøÍѤ·¤¿Êý¤¬Îɤ¤¤Ç¤·¤ç¤¦¡£




Tags: ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -

¿ÇÜĹ¥µ¥ó¥×¥ë¥¢¥×¥ê

¿·å¤Î½ü»»¤äÊ¿Êýº¬·×»»¤ò¼ÂÁõ¤·¤¿¥µ¥ó¥×¥ë¤Î16¿Ê¡¦£²¿Ê¡¦10¿ÊÅÅÂî¤Ç¤¹¡£
À°¿ô¤À¤±¤Ç¤¹¤¬¤ª¤è¤½100Ëü·å¤Þ¤Ç·×»»¤Ç¤­¤Þ¤¹¡£




¾è»»¤Ï¡¢¼Â¿ôFFT¤ÈKaratsubaË¡¤òÁȤ߹ç¤ï¤»¤Æ¤¤¤Þ¤¹¡£
¤³¤ÎÆâ¡¢¼Â¿ôFFT¤Ë¤Ï¡¢µþÂç¤ÎÂ籺Çî»Î¤ÎDFT¥³¡¼¥É(fftsg.c)¤Î°ìÉô¤òFPU²½¤·¤Æ»È¤Ã¤Æ¤¤¤Þ¤¹¡£
VC++¤À¤È³ÈÄ¥ÇÜÀºÅ٤Πlong double ¤¬»È¤¨¤Ê¤¤¤¿¤á¡¢¤Ç¤­¤ë¤À¤±FPU¤ò»È¤Ã¤ÆÀºÅÙ¤ò¹â¤á¤Æ¤¤¤Þ¤¹¡£
ÀºÅÙ¤¬¾å¤¬¤ë¤È°ìÅ٤˾軻¤Ç¤­¤ë·å¿ô¤¬¾å¤¬¤ê¡¢±þÅúÀ­¤¬¸þ¾å¤·¤Þ¤¹¡£
¤³¤Î¤È¤­¤ÎÀºÅ٤ˤĤ¤¤Æ¤Ï ¡Ö(*1)FFT¿ÇÜĹ¾è»»´ï¤ÎVLSIÀß·×¡× ¤ò»²¹Í¤Ë¡¢ºÇÂçÃͤɤ¦¤·¤Î¾è»»¤¬ºÇÂç¤Î¸íº¹¤òÍ¿¤¨¤ë¤È²¾Äꤷ¡¢£±Å٤˹Ԥ¨¤ëFFT¾è»»·å¿ô¤ò·èÄꤷ¤Æ¤¤¤Þ¤¹¡£
¤Þ¤¿¡¢£²¿Ê¢ª£±£°¿ÊÊÑ´¹¤Ë¤âFFT¾è»»¤¬É¬Íפˤʤê¤Þ¤¹¡£
¤³¤ì¤Ë¤Ï¿ÀÆàÀ²ÊÂç³Ø Ê¿»³Çî»Î¤Î¡Ö(*2)ʬ³äÅý¼£Ë¡¤Ë¤è¤ë¿ÇÜű黻¤Î¹â®²½¡×¤ò»²¹Í¤Ë¤·¤Þ¤·¤¿¡£


(*1) Ìðºê½Ó»Ö, °¤Éô¸øµ±: ¡ÖFFT ¿ÇÜĹ¾è»»´ï¤ÎVLSI À߷ס×, ÆüËܱþÍÑ¿ôÍý³Ø²ñÏÀʸ»ï, Vol.15, No.3, pp.385-401 (2005-9)

(*2) Ê¿»³¹°: ¡Öʬ³äÅý¼£Ë¡¤Ë¤è¤ë¿ÇÜű黻¤Î¹â®²½ (¿ô¼°½èÍý¤Ë¤ª¤±¤ëÍýÏÀ¤È±þÍѤ覵æ)¡×, ¿ôÍý²òÀϸ¦µæ½ê¹ÖµæÏ¿ (2000), 1138: 247-255





Tags: ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -

¥Ë¥å¡¼¥È¥óË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤ÎÀ°¿ôÊ¿Êýº¬

¿·å¤ÎÀ°¿ôÃÍ(s)¤ÎÊ¿Êýº¬ ¢ås ¤¬¤¢¤Ã¤¿¤È¤·¤Æ
¥Ë¥å¡¼¥È¥óË¡¡Ê£²¼¡Á²²½¼°¡Ë¤ò»È¤Ã¤Æ(s)¤ÎÊ¿Êýº¬¤ÎÀ°¿ôÉôʬ¤òµá¤á¤ëÊýË¡¤Ë¤Ä¤¤¤Æ¹Í¤¨¤Þ¤¹¡£
Í¿¤¨¤ë°ú¿ô(s)¤Ë´ð¿ô¤Î¤Ù¤­¾è¤ò³Ý¤±¤ë¤³¤È¤ÇǤ°Õ¤ÎÀºÅ٤˳ÈÄ¥¤Ç¤­¤Þ¤¹¡£ __Á°²óƱÍÍ__ ¹â¼¡Á²²½¼°¤Ë¤â±þÍѤǤ­¤Þ¤¹¤¬¡¢¤³¤³¤Ç¤Ï£²¼¡Á²²½¼°¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£

¢ås ¤òŸ³«¤¹¤ë¤È½ü»»¤¬É¬Íפˤʤë¤Î¤Ç, (1/¢ås)¤òµá¤á¡¢¤³¤ì¤Ë(s)¤ò¾è¤¸¤ë¤³¤È¤È¤·¤Þ¤¹¡£
(1/¢ås) ¤Î£²¼¡Á²²½¼°¤Ï¡¢

X(i+1) = X(i) * (3 - s * X(i)^2) / 2

¤Èɽ¤»¤Þ¤¹¡£
¤³¤ì¤Ï¡¢

Bigint iSqrt(Bigint s){
  int n = s.length(); // bit¿ô

  Bigint x = 1;
  x <<= (n / 2);  // NewtonË¡¤Î½é´üÃͤȤ·¤Æ, 1 << (n/2) ¤òÍ¿¤¨¤ë¡£
  Bigint m(0);
  Bigint t3 = 3;
  t3 <<= n;

  while(m != x){
    m = x;
    x *= t3 - ((s * x * x) >> n);
    x >>= (n + 1);
  }
  x *= s;         // x = s / ¢ås = ¢ås
  x >>= n;

  // ¸íº¹½¤Àµ
  m = x + 1;
  if (s >= m * m){
     x = m;
  }
  return x;
}


¤È½ñ¤±¤Þ¤¹¡£
¹Í¤¨Êý¤È¤·¤Æ¤Ï¡¢·×»»³Æ¹à¤ò¡¡(* 2n) ¤¹¤ë¤³¤È¤ÇÀ°¿ô¤ò°ì»þŪ¤Ë¸ÇÄê¾®¿ôÅÀ²½¤¹¤ë¤â¤Î¤Ç¤¹¡£
±é»»Î̤ò¸º¤é¤¹ÊÑ·Á¤ò½Å¤Í¤Æ¤¤¤ë¤Î¤Ç¤ï¤«¤ê¤Ë¤¯¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¢Èó¾ï¤Ëû¤¤¥³¡¼¥É¤Ç¤¹¡£
½é´üÃͤˤĤ¤¤Æ¤Ï¡¢Ê¿Êýº¬¤Ï (n/2)·åÄøÅ٤ˤʤë¤Î¤Ç¡¢¤½¤ÎµÕ¿ô¤â¤Þ¤¿ 2nÇܤ¹¤ë¤³¤È¤ò¹Í¤¨¤ì¤Ð¡¢
(n/2)·åÄøÅ٤Ǥ¢¤ë¤³¤È¤«¤é·èÄꤷ¤Æ¤¤¤Þ¤¹¤¬¡¢½é´üÃͤ¬´Å¤¤¤Î¤Ç¥ë¡¼¥×²ó¿ô¤Ï¤ä¤ä¿¤¤¤Ç¤¹¡£
¥Ë¥å¡¼¥È¥óË¡¤ò»È¤Ã¤¿½ü»»¤Ë¤Ä¤¤¤Æ¤Ï¡¢__¤³¤Á¤é__¤ò¤´Í÷¤¯¤À¤µ¤¤¡£

¡ÖNewtonË¡½é´üÃͤβþÎɥС¼¥¸¥ç¥ó¡×¤Ï¤³¤Á¤é
¥Ë¥å¡¼¥È¥óË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤ÎÀ°¿ôÊ¿Êýº¬(¤½¤Î£²)

(Ãí)¤³¤³¤Ç¤ÎBigint¥¯¥é¥¹¤Ï¡¢Â¿ÇÜĹÀ°¿ô¤ò³ÊǼ¤¹¤ë²¾ÁۤΥ¯¥é¥¹¤Ç¤¢¤ê¡¢¼Âºß¤¹¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£


Tags: ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -

¥Ë¥å¡¼¥È¥óË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤ÎÀ°¿ô½ü»»

½ü»» x = p / q ¤¬¤¢¤Ã¤¿¤È¤·¤Æ
¥Ë¥å¡¼¥È¥óË¡¡Ê£²¼¡Á²²½¼°¡Ë¤ò»È¤Ã¤Æ(q)¤ÎµÕ¿ô¤òµá¤á¡¢¤½¤ì¤Ë(p)¤ò¾è»»¤¹¤ëÊýË¡¤Ï¿·å±é»»¤ÎÄêÀФǤ¹¡£
¤³¤Î¾ì¹ç¡¢Â¿·å¤ÎÉâÆ°¾®¿ôÅÀ·¿¤ËÊÑ´¹¤·¤Æ±é»»¤¹¤ë¤³¤È¤¬Â¿¤¤¤Ç¤·¤ç¤¦¡£
¤³¤³¤Ç¤Ï¡¢¥Ë¥å¡¼¥È¥óË¡¤òÀ°¿ô±é»»¤Î¤ß¤Ç¼ÂÁõ¤¹¤ëÊýË¡¤Ë¤Ä¤¤¤Æ¹Í¤¨¤Þ¤¹¡£
¹â¼¡Á²²½¼°¤Ë¤â±þÍѤǤ­¤Þ¤¹¤¬¡¢¤³¤³¤Ç¤Ï£²¼¡Á²²½¼°¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡£

1/q ¤Î£²¼¡Á²²½¼°¤Ï¡¢

X(i+1) = X(i) * (2 - q * X(i))

¤Èɽ¤»¤Þ¤¹¡£
¤³¤³¤ÇÈï½ü¿ô¤ÎBit¿ô¤òpb, ½ü¿ô¤ÎBit¿ô¤òqb¤È¤·¤Æ¡¢n = pb + qb ¤È¤¹¤ì¤Ð


Bigint iDiv(Bigint p, Bigint q){
  int pb = p.length(); // Èï½ü¿ô¤Îbit¿ô
  int qb = q.length(); // ½ü¿ô¤Îbit¿ô
  int n = pb + qb;

  Bigint m(0);
  Bigint x = 1;
  x <<= pb;      // NewtonË¡¤Î½é´üÃͤȤ·¤Æ, 1 << pb ¤òÍ¿¤¨¤ë¡£
  Bigint c2 = 2;
  c2 <<= n;

  while(m != x){
    m = x;
    x *= c2 - q * x;
    x >>= n;
  }
  x *= p;        // x = p / q
  x >>= n;

  // ¸íº¹½¤Àµ
  if (p >= (x+1)*q){
      x += 1;
  }
  return x;
}


¤È½ñ¤±¤Þ¤¹¡£
¹Í¤¨Êý¤È¤·¤Æ¤Ï¡¢·×»»³Æ¹à¤ò¡¡(* 2n) ¤¹¤ë¤³¤È¤ÇÀ°¿ô¤ò°ì»þŪ¤Ë¸ÇÄê¾®¿ôÅÀ²½¤¹¤ë¤â¤Î¤Ç¤¹¡£
±é»»Î̤ò¸º¤é¤¹ÊÑ·Á¤ò½Å¤Í¤Æ¤¤¤ë¤Î¤Ç¤ï¤«¤ê¤Ë¤¯¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¢Èó¾ï¤Ëû¤¤¥³¡¼¥É¤Ç¤¹¡£
⤷¡¢½é´üÃͤ¬´Å¤¤¤Î¤Ç¥ë¡¼¥×²ó¿ô¤Ï¤ä¤ä¿¤¤¤Ç¤¹¡£
Èï½ü¿ô¤È½ü¿ô¤Î·åº¹¤¬¾¯¤Ê¤¤¾ì¹ç¤Ï¡¢²óÉüË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤Î½ü»»¤¬Í­Íø¤Ç¤¹¡£


¡ÖNewtonË¡½é´üÃͤβþÎɥС¼¥¸¥ç¥ó¡×¤Ï¤³¤Á¤é
¥Ë¥å¡¼¥È¥óË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤ÎÀ°¿ô½ü»»(¤½¤Î£²)

(Ãí)¤³¤³¤Ç¤ÎBigint¥¯¥é¥¹¤Ï¡¢Â¿ÇÜĹÀ°¿ô¤ò³ÊǼ¤¹¤ë²¾ÁۤΥ¯¥é¥¹¤Ç¤¢¤ê¡¢¼Âºß¤¹¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£


Tags: ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -

¥â¥ó¥´¥á¥ê¾è»» ¥µ¥ó¥×¥ë¥³¡¼¥É

¥¦¥£¥­¤Ú¥Ç¥£¥¢¤Ç¥â¥ó¥´¥á¥ê¾è»»¤ò¸¡º÷¤¹¤ë¤È¡¢¤ï¤«¤ê°×¤¯¾Ü¤·¤¤ÀâÌÀ¤¬ºÜ¤Ã¤Æ¤¤¤ë¡£
»ÄÇ°¤Ê¤¬¤é¤³¤ÎÀâÌÀÁ´ÂΤò¥×¥í¥°¥é¥ß¥ó¥°¤·¤¿¤â¤Î¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤Î¤ÇC++¥½¡¼¥¹¤ò½ñ¤¤¤Æ¤ß¤¿¡£


// ¥â¥ó¥´¥á¥ê¾è»»¾ê;±é»» c = (a*b) mod n¤òµá¤á¤ë
// gcd(n,r) == 1 ¤È¤Ê¤ë¤³¤È¡£(n¤Ï´ñ¿ô¤Ç¤¢¤ì¤ÐÎɤ¤)
//
Bigint Montgomery(const Bigint& a, const Bigint& b, const Bigint& n) const{
  // n ¤òË¡¤È¤¹¤ë
  // BitŤòÄ´¤Ù¤ë(nb)
  int nb = n.length();

  // r: n¤è¤êÂ礭¤Ê£²¤Î¤Ù¤­
  Bigint r(1);
  r <<= nb;

  // r2 = r^2 mod n
  Bigint r2(r*r);
  r2 %= n;

  // n*n2 ¢á -1 mod r
  Bigint n2 = 0; /* µá¤á¤ëN' */
  Bigint t = 0;
  Bigint vi = 1;
  int ni = nb;
  while (ni--){ /* R¤Î¥È¥Ã¥×¥Ó¥Ã¥È¤ò½ü¤¤¤¿¥Ó¥Ã¥È¿ôʬ·«¤êÊÖ¤¹ */
    if ((t & 1) == 0){
      /* ¥¼¥í¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥Ó¥Ã¥È¤¬¤¢¤Ã¤¿¤é¡¢N'¤Î¤½¤ÎÉôʬ¤ò1¤Ë¤¹¤ë¡ÊN¤ÏR¤È¸ß¤¤¤ËÁǤʤΤÇɬ¤º´ñ¿ô¡Ë*/
      t += n; /* ³Ý¤±»»¤À¤¬¡¢Æó¿Ê¿ô°ì·å¤Î³Ý¤±»»¤Ê¤Î¤Ç¼Â¼Á¤Ï­¤·»» */
      n2 += vi; /* N'¤Î¤½¤ÎÉôʬ¤ò1¤Ë¤¹¤ë */
    }
    t >>= 1; /* ɬ¤ºÃ¼¿ô¤¬½Ð¤ë¤¬ÀÚ¤ê¼Î¤Æ¤ë */
    vi <<= 1; /* R¤Ï2¤ÎÑѤʤΤǡ¢ÀäÂÐü¿ô¤Ï½Ð¤Ê¤¤ */
  }
  // ¤³¤³¤Þ¤Ç¤Ç¡¢º£¸å·×»»¤ËɬÍפˤʤ롢r2,n,nb,n2¤¬ÆÀ¤é¤ì¤ë¡£
  // ¤Ä¤Þ¤ên¤òË¡¤È¤¹¤ë¥â¥ó¥´¥á¥ê¥¯¥é¥¹¤òºîÀ®¤¹¤ë¤Ê¤é
  // °ú¿ôn¤ò¥³¥ó¥¹¥È¥é¥¯¥¿¤È¤¹¤ë¥¯¥é¥¹¤òºîÀ®¤·¡¢
  // r2,n,nb,n2¤ò¥á¥ó¥ÐÊÑ¿ô¤È¤¹¤ë¡£


  // a¤Î¥â¥ó¥´¥á¥êɽ¸½¤òam, b¤Î¥â¥ó¥´¥á¥êɽ¸½¤òbm¤È¤¹¤ë
  // t ¤Ïºî¶ÈÎΰè
  t = a * r2;
  Bigint am = t * n2;
  am.hibitmask(nb); // mod R¤Î°ÕÌ£,(nb)bit°Ê¾å¤ò0¥¯¥ê¥¢
  am *= n;
  am += t;
  am >>= nb; // 1/R¤Î°ÕÌ£
  if (am >= n) am -= n;

  t = b * r2;
  Bigint bm = t * n2;
  bm.hibitmask(nb); // mod R¤Î°ÕÌ£,(nb)bit°Ê¾å¤ò0¥¯¥ê¥¢
  bm *= n;
  bm += t;
  bm >>= nb; // 1/R¤Î°ÕÌ£
  if (bm >= n) bm -= n;

  // cm: am * bm ¤Î¥â¥ó¥´¥á¥ê¥ê¥À¥¯¥·¥ç¥ó
  t = (am * bm);
  Bigint cm = t * n2;
  cm.hibitmask(nb); // mod R¤Î°ÕÌ£,(nb)bit°Ê¾å¤ò0¥¯¥ê¥¢
  cm *= n;
  cm += t;
  cm >>= nb; // 1/R¤Î°ÕÌ£
  if (cm >= n) cm -= n;

  // cm¤Î¥â¥ó¥´¥á¥ê¥ê¥À¥¯¥·¥ç¥ó
  t = cm;
  Bigint c = t * n2;
  c.hibitmask(nb); // mod R¤Î°ÕÌ£,(nb)bit°Ê¾å¤ò0¥¯¥ê¥¢
  c *= n;
  c += t;
  c >>= nb; // 1/R¤Î°ÕÌ£
  if (c >= n) c -= n;

  return c;
}



¤³¤³¤Ç¤Ï¡¢¤Ç¤­¤ë¤À¤±wikipedia¤ÎÀâÌÀ¤È¹çÃפ¹¤ë¤è¤¦¤Ë½ñ¤­¤Þ¤·¤¿¤¬¡¢
¼ÂÍøÍѤκݤˤϡ¢r2 = r^2 mod n ¤Î·×»»¤¬½Å¤¤¤Î¤Ç¡¢
¡Ê¤³¤ì¤¬Áᤱ¤ì¤Ð¡¢¤½¤â¤½¤â¥â¥ó¥´¥á¥ê±é»»¤ÎɬÍפ¬¤Ê¤¤¡Ë
n¤òË¡¤È¤¹¤ë¥â¥ó¥´¥á¥ê¥¯¥é¥¹¤òºîÀ®¤¹¤ë¤Î¤¬Îɤ¤¤Ç¤¹¡£
¤Ä¤Þ¤ê¥³¡¼¥ÉÃæ¤Ë¤â½ñ¤¤¤Æ¤¢¤ë¤è¤¦¤Ë¡¢°ú¿ôn¤ò¥³¥ó¥¹¥È¥é¥¯¥¿¤È¤·¤¿¥â¥ó¥´¥á¥ê¥¯¥é¥¹¤òºîÀ®¤·¡¢r2,n,nb,n2¤Ï¥á¥ó¥ÐÊÑ¿ô¤Ë¤·¤Æ¡¢¥â¥ó¥´¥á¥ê¥ê¥À¥¯¥·¥ç¥ó, ¾è»»¾ê;±é»», ²Ã¸º»»¾ê;±é»», ÑѾê;±é»»Åù¤Ï¡¢¥â¥ó¥´¥á¥ê¥¯¥é¥¹¤ÎMethod¤Ë¤·¤Þ¤¹¡£

¢¨¤³¤³¤Ç½ñ¤¤¤¿¾è»»¤Ï¡Ö¾è»»¾ê;±é»»¡×¤Î¹à¤Î¾åÃʤˤ¢¤ëÊýË¡¤Ç¤¹¡£

(Ãí)¤³¤³¤Ç¤ÎBigint¥¯¥é¥¹¤Ï¡¢Â¿ÇÜĹÀ°¿ô¤ò³ÊǼ¤¹¤ë²¾ÁۤΥ¯¥é¥¹¤Ç¤¢¤ê¡¢¼Âºß¤¹¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£


Tags: ¥â¥ó¥´¥á¥êÑѾê;¥µ¥ó¥×¥ë¥³¡¼¥É     ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -

²óÉüË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤Î½ü»»(¤½¤Î£²)

Á°²óƱÍÍ¡¢½ü»» a = x / y ¤¬¤¢¤Ã¤¿¤È¤·¤Æ
¼°¤òÊÑ·Á¤·¤Æ¡¢

a = (x * (2^(2k)-1)/y + 2^k) >> 2k  (k:=Èï½ü¿ô¤Îbit¿ô)

¤È¤¹¤ì¤Ð¡¢µÕ¿ô¤òµá¤á¤ëÉôʬ((2^(2k)-1)/y)¤Î²óÉüË¡¤â¤Þ¤¿Æüì¤ÊÈï½ü¿ô¤Î¤¿¤á¡¢´Êñ¤Ê¤â¤Î¤ËÊÑ·Á¤Ç¤­¤ë¡£

Bigint iDiv(Bigint x, Bigint y){
  int xb = x.length(); // Èï½ü¿ô¤Îbit¿ô
  int yb = y.length(); // ½ü¿ô¤Îbit¿ô
  int n = xb * 2 - 1; // ¥ë¡¼¥×²ó¿ô

  Bigint a(0), m(0);
  while (n--){
    m |= 1;
    a <<= 1;
    if (m >= y){
      m -= y;
      a |= 1;
    }
    m <<= 1;
  }
  a *= x;
  m = 1;
  m <<= xb;
  a += m;
  return a >> (xb*2-1);
}

¤³¤ÎÊýË¡¤Ï¡¢Èï½ü¿ôbit¿ô¤ÎÇܤΥ롼¥×¤È¤Ê¤ê¡¢¤³¤ì¤¬ºÇÂç¤Î¸º»»²ó¿ô¤Ë¤Ê¤ê¤Þ¤¹¡£
¤·¤«¤·¸íº¹¤¬½Ð¤Ê¤¤¤Î¤Ç¾è»»¤Ï£±²ó¤À¤±¤ÇºÑ¤ß¤Þ¤¹¡£
Á°²ó¤ÎÊýË¡¤Ïbitº¹¤Ë°Í¸¤·¤¿¥ë¡¼¥×²ó¿ô¤Ê¤Î¤Ç¿·å¤Ë¤â±þÍѤǤ­¤Þ¤¹¤¬¡¢¤³¤ÎÊýË¡¤À¤ÈÈï½ü¿ô¤¬Â礭¤¤¤È¥ë¡¼¥×²ó¿ô¤¬Â¿¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£

·åº¹¤¬¾®¤µ¤¤»þ¤ËÍ­Íø¤ÊÊýË¡

¥Ë¥å¡¼¥È¥óË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤ÎÀ°¿ô½ü»»

(Ãí)¤³¤³¤Ç¤ÎBigint¥¯¥é¥¹¤Ï¡¢Â¿ÇÜĹÀ°¿ô¤ò³ÊǼ¤¹¤ë²¾ÁۤΥ¯¥é¥¹¤Ç¤¢¤ê¡¢¼Âºß¤¹¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£


Tags: ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -

²óÉüË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤Î½ü»»

½ü»» a = x / y ¤¬¤¢¤Ã¤¿¤È¤·¤Æ
²óÉüË¡¤ò»È¤¦¤ÈÈï½ü¿ô¤Îbit¿ôʬ¤Î²Ã»»¡¦¸º»»¤ò·«¤êÊÖ¤·¹Ô¤¦¤³¤È¤Ë¤Ê¤ë
¼°¤òÊÑ·Á¤·¤Æ¡¢

a = (x * ((2^k)/y) >> k  (k:=Èï½ü¿ô¤Îbit¿ô)

¤È¤¹¤ì¤Ð¡¢µÕ¿ô¤òµá¤á¤ëÉôʬ((2^k)/y)¤Î²óÉüË¡¤ÏÆüì¤ÊÈï½ü¿ô¤Î¤¿¤á¡¢´Êñ¤Ê¤â¤Î¤ËÊÑ·Á¤Ç¤­¤ë¡£

Bigint iDiv(Bigint x, Bigint y){
  Bigint a(0), m(1);
  int xb = x.length(); // Èï½ü¿ô¤Îbit¿ô
  int yb = y.length(); // ½ü¿ô¤Îbit¿ô
  int n = xb - yb + 1; // ¥ë¡¼¥×²ó¿ô(bitº¹+1)

  m <<= yb-1;
  while (n--){
    a <<= 1;
    if (m >= y){
      m -= y;
      a |= 1;
    }
    m <<= 1;
  }
  a *= x;
  a >>= (xb - 1);

  // ¸íº¹½¤Àµ(¤³¤³¤Ç¤Îa¤Ï,Àµ²ò¤è¤ê1or2¾®¤µ¤¤¾ì¹ç¤¬¤¢¤ë)
  m = y * a;
  while(x > m){
    m += y;
    if (x > m)
      a += 1;
  }
  return a;
}


¤È½ñ¤±¤ë¡£
·×»»Î̤ϺÇÂç¤Ç¤âbitº¹ÄøÅ٤βøº»»¤È£²²ó¤Î¾è»»¤Ê¤Î¤Ç
bitº¹¤¬¿ô100¤Î¥ª¡¼¥À¡¼¤Ê¤éNewtonË¡¤ò»È¤¦¤è¤êÍ­Íø¤«¤â¡£

¥Ë¥å¡¼¥È¥óË¡¤ò»È¤Ã¤¿£²¿Ê¿·å¤ÎÀ°¿ô½ü»»

(Ãí)¤³¤³¤Ç¤ÎBigint¥¯¥é¥¹¤Ï¡¢Â¿ÇÜĹÀ°¿ô¤ò³ÊǼ¤¹¤ë²¾ÁۤΥ¯¥é¥¹¤Ç¤¢¤ê¡¢¼Âºß¤¹¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£


Tags: ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -

PerformanceCounter¤ò»È¤Ã¤¿¥Þ¥¤¥¯¥íÉûþ·×

PerformanceCounter¤ò»È¤Ã¤¿¥Þ¥¤¥¯¥íÉûþ·×

Linux¤Ë¤Ï¡¢gettimeofday¤¬¤¢¤ê¤Þ¤¹¤¬¡¢
Windows¤Ë¤Ï¡¢¥Þ¥¤¥¯¥íÉäޤǷ׬²Äǽ¤ÊAPI¤ÏÍÑ°Õ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£

PerformanceCounter¤ò»È¤¨¤Ð¤«¤Ê¤êÀµ³Î¤Ê»þ´Ö´Ö³Ö¤òÃΤ뤳¤È¤Ï¤Ç¤­¤Þ¤¹¤¬¡¢
»þ·×¤È¤·¤ÆÍøÍѤ¹¤ë¤³¤È¤Ï´Êñ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¤¢¤ëÄøÅٴѬ¤ò¤·¤Æ¤¤¤ë¤È¡¢ansiɸ½à¤Î_ftime¤È¤Ï¥º¥ì¤Æ¤¤¤­¤Þ¤¹¡£
¤³¤Î¤¿¤á¡¢_ftime¤ò¥Ù¡¼¥¹¤È¤·¤Æ¥ß¥êÉðʲ¼¤ÎÉôʬ¤òPerformanceCounter¤«¤éÆÀ¤ë¤³¤È¤ò¹Í¤¨¤Þ¤·¤¿¤¬¡¢ÉäÎÊѤï¤êÌܤǻþ·×¤¬µÕ¤Ë¿Ê¤à¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£
¤½¤³¤Ç¡¢ftime¤ÈPerformanceCounter¤«¤éÆÀ¤é¤ì¤ë»þ´Öº¹¤òÄ´Àᤷ¡¢
»þ·×¤¬µÕ¤Ë¿Ê¤à¤³¤È¤¬¤Ê¤¤¤è¤¦¤Ê¥Þ¥¤¥¯¥íÉûþ·×¤òºî¤Ã¤Æ¤ß¤Þ¤·¤¿¡£

usec.h

// (c) Hundredsoft Corporation 2010 All rights reserved.

#ifndef USEC_INCLUDED
#define USEC_INCLUDED
class usec
{
public:
	usec();
	~usec(){}
	__int64 get();
private:
	__int64 microfunc(__int64 a, __int64 b);
	__int64 usec::getstm();
	LARGE_INTEGER m_ti;
	LARGE_INTEGER m_tfi;
	__int64 m_msi;
	__int64 m_lastus;
	bool m_isSuported;
};
#endif



usec.cpp

// (c) Hundredsoft Corporation 2010 All rights reserved.

#include <windows.h>
#include <time.h>
#include <sys/timeb.h>
#include "usec.h"

usec::usec()
{
	m_isSuported = false;
	if (QueryPerformanceFrequency(&m_tfi)){
		if (QueryPerformanceCounter(&m_ti)){
			m_isSuported = true;
		}
	}
	m_msi = getstm();
}

__int64 usec::microfunc(__int64 a, __int64 b)
{
	__int64 ah, al, a0, m = 0;
	int i;
	ah = (a >> 44) & 0xffff;
	al = a << 20;
	for (i=0; i<128; i++){
		m <<= 1;
		if (ah < 0) m |= 1;
		ah <<= 1;
		if (al < 0) ah |= 1;
		al <<= 1;
		if (m >= b){
			m -= b;
			al |= 1;
		}
	}
	a0 = al;
	ah = (a0 >> 44) & 0xffff;
	al = a0 << 20;
	m = 0;
	for (i=0; i<128; i++){
		m <<= 1;
		if (ah < 0) m |= 1;
		ah <<= 1;
		if (al < 0) ah |= 1;
		al <<= 1;
		if (m >= 22634874){
			m -= 22634874;
			al |= 1;
		}
	}
	return a0 - al;
}

__int64 usec::getstm()
{
	_timeb  tb;
	_ftime(&tb);
	struct tm* stm = localtime(&tb.time);
	__int64 stms = (stm->tm_hour * 3600000 + stm->tm_min * 60000 + stm->tm_sec * 1000 + tb.millitm);
	return stms * 1000;
}

__int64 usec::get()
{
	__int64 utm;
	if (m_isSuported){
		LARGE_INTEGER t, tf;
		QueryPerformanceFrequency(&tf);
		QueryPerformanceCounter(&t);
		__int64 stms = getstm();
		__int64 diff = t.QuadPart-m_ti.QuadPart;
		if (diff > 0){
			utm = m_msi + microfunc(diff, tf.QuadPart);
			diff = utm - stms;
		}else{
			utm = stms;
			diff = 999999999;
		}
		__int64 absdiff = (diff < 0) ? -diff : diff;
		if (m_tfi.QuadPart != tf.QuadPart || absdiff > 10000){
			m_tfi = tf;
			m_ti = t;
			m_msi = stms;
			if (diff > 0){
				if (utm - m_lastus > 10 )
					utm = (m_lastus + utm) / 2;
				else
					utm = m_lastus + 2;
			}else{
				if (absdiff > 3600000000)
					utm = m_msi;
				else
					utm = (utm + m_msi) / 2;
			}
		}
		m_lastus = utm;
	}else{
		utm = getstm();
	}
	return utm;
}





¥Æ¥¹¥ÈÍÑ¥³¡¼¥É
main.cpp

#include <tchar.h>
#include <windows.h>
#include <stdio.h>
#include "usec.h"

#include <time.h>
#include <sys/timeb.h>

int main(int argc, char**argv)
{
	usec ut;
	while(1){
		char work[256];
		__int64 utm = ut.get();

		_timeb  tb;
		_ftime(&tb);
		struct tm* stm = localtime(&tb.time);

		sprintf(work, "%02d:%02d:%02d.%06d [%02d.%03d]",
				(int)((utm / 3600000000) % 24),
				(int)((utm / 60000000) % 60),
				(int)((utm / 1000000) % 60),
				(int)(utm % 1000000),
				stm->tm_sec,
				tb.millitm
				);
		printf("%s\n", work);
		Sleep(300);
	}
}
usec::microfunc¤Ï¡¢PerformanceCounter¤«¤éÆÀ¤é¤ì¤ëÃÍ(LARGE_INTEGER)¤«¤é
¥Þ¥¤¥¯¥íÉäòÆÀ¤ë128bit½ü»»¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£

¤¢¤ë»þ´Öº¹(t0¡Át1)¤¬¤¢¤Ã¤¿¤È¤·¤Æ
t0,t1¤ÏQueryPerformanceCounter¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤ëÃͤȤ·¤Þ¤¹¡£
t = t1 - t0¡¢¤³¤Î»þ´Ö´Ö³Ö¤Ï¡¢¼þÇÈ¿ô:f(QueryPerformanceFrequency¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤ë)¤È¤·¤Æ
t / f ¤ÇÆÀ¤é¤ì¤Þ¤¹¤¬¡¢
À°¿ô±é»»¤Ç¥Þ¥¤¥¯¥íÉäòÆÀ¤¿¤¤¤Î¤Ç
t * 1000000 / f
¤È¤Ê¤ê¤Þ¤¹¡£
¤³¤Î¤Þ¤Þdouble¤Ç±é»»¤·¤Æ¤âÎɤ¤¤Î¤Ç¤¹¤¬À°¿ô±é»»¤Ë¹´¤Ã¤Æ¡¢
t * (1024*1024 - 48576) / f
= 1024*1024 * t / f * (1 - 1 / 21.58629776021)
= 1024*1024 * t / f * (1 - 1024*1024 / 22634874)
A = (t << 20) / f
¤ÈÃÖ¤±¤Ð
¢âA - (A << 20) / 22634874 [¦ÌSec]¤È¤Ê¤ê¤Þ¤¹¡£
¤³¤ì¤Ï¡¢64bit¤òĶ¤¨¤ë±é»»¤Ë¤Ê¤ê¤Þ¤¹¤Î¤Çfor¤Ç²ó¤·¤Æ·×»»¤·¤Æ¤¤¤Þ¤¹¡£

¥Æ¥¹¥ÈÍÑ¥³¡¼¥É¤Ç¤Ï¡¢usec¥¯¥é¥¹¤«¤éÆÀ¤é¤ì¤¿¥Þ¥¤¥¯¥íÉûþ´Ö¤È¶¦¤Ë¡¢
_ftime¤Ë¤è¤ë¡ÖÉᢥߥêÉáפâɽ¼¨¤·¤Æ¤¤¤Þ¤¹¡£

usec::get¤Ç¤Ï¡¢ftime¤ÈPerformanceCounter¤«¤éÆÀ¤é¤ì¤ë»þ´Öº¹¤òÄ´Àᤷ¤Æ¤¤¤ë¤Î¤Ç¡¢
¤½¤ì¤Û¤ÉÀºÅ٤ι⤤»þ·×¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢¥ß¥êÉÃñ°Ì¤Î»þ·×¤À¤È¥ë¡¼¥×´Ö³Ö¤òû¤¯Sleep(10)¤È¤«¤Ë¤¹¤ë¤È¡¢Æ±¤¸»þ´Ö¤¬Â³¤¤¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
¤³¤Î»þ·×¤Î¾ì¹ç¤Ï¡¢¥ë¡¼¥×´Ö³Ö(Sleep)¤òû¤¯¤·¤Æ¤â¡¢Æ±¤¸»þ´Ö¤¬Ê¤֤褦¤Ê¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£

¢¨¹âʬ²òǽ¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥«¥¦¥ó¥¿¤¬¤Ê¤¤PC¤Ç¤Ï¡¢¥ß¥êÉÃñ°Ì¤Î½ÐÎϤȤʤê¤Þ¤¹¡£



usec.zip¥½¡¼¥¹¤Ï¤³¤Á¤é



Tags: ¥×¥í¥°¥é¥à¥á¥â
author : HUNDREDSOFT | - | -

ÁǺà8

Àã·ë¾½



08_snow1.swf





.


Tags: ÁǺà
author : HUNDREDSOFT | - | -

¥¹¥Ñ¥¤¥À¡¼¥½¥ê¥Æ¥£¥¢

¤È¤¦¤È¤¦É餱¤¿¡£1764Ï¢¾¡¤ÇÅÓÀڤ졣

SpiderSolitaire.gif
author : HUNDREDSOFT | - | -

ÁǺà7

¥ê¥ó¥´

07_¥ê¥ó¥´4.pdf





.


Tags: ÁǺà
author : HUNDREDSOFT | - | -

ÁǺࣵ

¥Ð¥é¤È¥Á¥ç¥³¥ì¡¼¥È
06_choco5.pdf




.


Tags: ÁǺà
author : HUNDREDSOFT | - | -

ÁǺࣴ

¥°¥é¥¹¤È¤«

05_¥°¥é¥¹6.pdf




.


Tags: ÁǺà
author : HUNDREDSOFT | - | -

ÁǺࣳ

¿·Ç¯

04a_¿·Ç¯.pdf



.


Tags: ÁǺà
author : HUNDREDSOFT | - | -

ÁǺࣲ

¤¿¤­²Ð¡£

03_¤¿¤­²Ð.pdf




.


Tags: ÁǺà
author : HUNDREDSOFT | - | -