x86 assembly (MASM) - Square root of a 64-bit integer?

后端 未结 6 2073
陌清茗
陌清茗 2021-01-07 10:12

I\'m coding a simple primality tester program for Windows in x86 assembly language (MASM32), which involves calculating a square root of a (64-bit) integer. My question is:

6条回答
  •  心在旅途
    2021-01-07 10:53

    You mean other than by using the FSQRT instruction? Sure, it's floating-point, but it should be easy enough to do the conversion. Otherwise you have to use something like Newton's Method.

提交回复
热议问题