关于tc中的“floating point formats not linked" or "floating point not loaded"

转载:

Why   did   my   program   bomb   at   run   time   with   'floating   point   formats   not   linked'   or   'floating   point   not   loaded'?  
   
  --------------------------------------------------------------------------------  
   
  Date:   5   Feb   2002   22:03:03   -0400  
   
    These   messages   look   similar   but   have   very   different   causes.  
   
    "Floating   point   not   loaded"   is   Microsoft   C's   run-time   message   when   the  
    code   requires   a   numeric   coprocessor   but   your   computer   doesn't   have   one  
    installed.   If   the   program   is   yours,   relink   it   using   the   xLIBCE   or   xLIBCA  
    library   (where   x   is   the   memory   model).  
   
    "Floating   point   formats   not   linked"   is   a   Borland   run-time   error   (Borland  
    C   or   C++,   Turbo   C   or   C++).   Borland's   compilers   try   to   be   smart   and   not  
    link   in   the   floating-   point   (f-p)   library   unless   you   need   it.   Alas,   they  
    all   get   the   decision   wrong.   One   common   case   is   where   you   don't   call   any  
    f-p   functions,   but   you   have   %f   or   other   f-p   formats   in   scanf()   or  
    printf()   calls.   The   cure   is   to   call   an   f-p   function,   or   at   least   force  
    one   to   be   present   in   the   link.  
   
    To   do   that,   define   this   function   somewhere   in   a   source   file   but   don't  
    call   it:  
   
        static   void   forcefloat(float   *p)  
        {  
            float   f   =   *p;  
            forcefloat(&f);  
        }  
   
    It   doesn't   have   to   be   in   the   module   with   the   main   program,   as   long   as  
    it's   in   a   module   that   will   be   included   in   the   link.  
   
    If   you   have   Borland   C++   3.0,   the   README   file   documents   a   slightly   less  
    ugly   work-around.   Insert   these   statements   in   your   program:  
   
        extern   unsigned   _floatconvert;  
        #pragma   extref   _floatconvert  

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 在C语言floating point是指浮点数,它是一种表示实数的数值表示方式。在程序如果出现了"C runtime error floating point support not loaded"的错误提示,这通常是因为程序在执行过程需要用到浮点数运算,但是计算机系统没有正确加载浮点库造成的。 要解决这个问题,我们可以尝试以下几个步骤: 1.检查代码:首先我们需要检查一下程序的代码,看看是否有涉及到浮点数运算的部分。如果有,就要确认代码是否有错误,如果没有错误,则有可能是浮点库没有正确加载造成的。 2.查看运行环境:接下来,我们需要查看运行该程序的计算机系统是否正确加载了浮点库。如果发现没有加载,我们可以尝试通过重新安装计算机系统或者更新浮点库等方式来解决问题。 3.使用其他方法处理:最后,如果以上方法都不能解决问题,我们可以考虑采用其他方法来处理程序的浮点数运算,例如采用定点数运算或者使用其他库来进行计算。 综上所述,C runtime error floating point support not loaded是一个常见的错误提示,在遇到这个问题时,我们要仔细检查代码和计算机环境,采取合适的解决方法,以确保程序的正确运行。 ### 回答2: C语言运行时错误浮点支持未加载。这个错误通常发生在使用浮点数运算时,系统缺少必要的浮点库文件或者这些库文件没有被正确链接引用。在程序执行过程,如果遇到这个错误就会导致程序崩溃。 解决此问题的方法是检查编译选项和链接选项,确保已经正确设置了相关的浮点库文件。如果这些库文件确实缺失,需要手动安装或更新浮点库,以便程序可以正常运行。 另外,C语言的浮点运算有时会产生舍入误差,也可能会导致运行时错误。因此,在进行浮点数运算时,应该选择合适的数据类型,并使用适当的算法和方法,以减少舍入误差的影响,并尽可能避免运行时错误的发生。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值