ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Andrey Rybak <ra@iop.kiev.ua>
To: "Список рассылки по использованию дистрибутивов ALT Linux"
	<community@altlinux.ru>
Subject: Re: [Comm] value overflow on C
Date: Wed, 22 Feb 2006 14:51:18 +0200
Message-ID: <43FC5E46.9000909@iop.kiev.ua> (raw)
In-Reply-To: <20060222115141.GG19814@damir.rnd.local>


> ИМХО глобально решить проблему можно только если использовать другие языки.
> В случае целочисленных выражений проблему можно сгладить, просто взяв int
> тип пошире (например, long long).
>
>   
В том то и дело, что взять тип пошире - не кошерно в моем случае.
Расчеты величин проходят в их (величин) зонах сингулярности, где область 
значений резко увеличивается  даже при малых изменениях аргумента. В 
тоже время увеличив ширину типа, я увеличу и так большое время счета. 
Поэтому мне надо просто детектировать, что я подошел к предельным 
величинам. Просто условными оператороми (if например) эта задача 
решается неудовлетворительно.
А вопрос у меня возник, потому что помнится мне, что в ассемблере есть 
флажок переполнения байта величины (при инкременте например), поэтому 
думается мне, что при близости Си к низкоуровнему программированию, 
такая фича (определение превышения допустимой величины) должна быть. 
Именно поэтому я привел пример с ERANGE.

Есть еще идеи?


  reply	other threads:[~2006-02-22 12:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-22 11:25 Andrey Rybak
2006-02-22 11:51 ` Damir Shayhutdinov
2006-02-22 12:51   ` Andrey Rybak [this message]
2006-02-22 12:56     ` Damir Shayhutdinov
2006-02-22 13:41       ` Andrey Rybak
2006-02-22 14:23         ` Serge Skorokhodov
2006-02-22 14:36           ` Andrey Rybak
2006-02-22 15:13             ` Yura Kalinichenko
2006-02-23  9:39             ` Serge Skorokhodov
2006-02-23  9:51               ` Kaydannik Axel
2006-02-22 19:54         ` Kosserior
2006-02-22 17:28 ` spider
2006-02-22 18:19   ` Хихин Руслан
2006-02-25 12:07   ` Andrey Rybak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43FC5E46.9000909@iop.kiev.ua \
    --to=ra@iop.kiev.ua \
    --cc=community@altlinux.ru \
    --cc=community@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git