<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://bsd.neuroinf.jp/w/index.php?action=history&amp;feed=atom&amp;title=%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%3ATrunc</id>
	<title>テンプレート:Trunc - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://bsd.neuroinf.jp/w/index.php?action=history&amp;feed=atom&amp;title=%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88%3ATrunc"/>
	<link rel="alternate" type="text/html" href="https://bsd.neuroinf.jp/w/index.php?title=%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88:Trunc&amp;action=history"/>
	<updated>2026-04-28T22:59:54Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://bsd.neuroinf.jp/w/index.php?title=%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88:Trunc&amp;diff=29290&amp;oldid=prev</id>
		<title>Nijcadmin: 1版</title>
		<link rel="alternate" type="text/html" href="https://bsd.neuroinf.jp/w/index.php?title=%E3%83%86%E3%83%B3%E3%83%97%E3%83%AC%E3%83%BC%E3%83%88:Trunc&amp;diff=29290&amp;oldid=prev"/>
		<updated>2015-03-14T03:15:29Z</updated>

		<summary type="html">&lt;p&gt;1版&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;{{trunc/1|{{formatnum:{{{1}}}|R}}|{{formatnum:{{{2|}}}|R}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This template produces an expression for the truncated value of a given expression. If the value is in the range of integer-type numbers (in the range {{numf|trunc-2^63}} through {{numf|trunc(2^63-1024)+trunc1023}}), the resulting expression is of type integer.&lt;br /&gt;
&lt;br /&gt;
The template also serves as a tool to enter an integer larger than {{numf|2^53}}, avoiding rounding to float: split the digits up into two parameters, each forming an integer not larger than that limit, and avoiding leading zeros in the second parameter. If the latter requires a larger first parameter: for every trailing 0 it can be a factor 2 larger then mentioned (see also [[Help:Calculation accuracy#Integers]]). To enter an integer smaller than -{{numf|2^53}} explicitly, do the same with a minus sign before each part.&lt;br /&gt;
 &lt;br /&gt;
Thus, when applying &amp;lt;code&amp;gt;#expr&amp;lt;/code&amp;gt;, if the value is in the range of integer-type numbers the exact result is produced. The reason for not applying &amp;lt;code&amp;gt;#expr&amp;lt;/code&amp;gt; in this template is:&lt;br /&gt;
*for integer-type numbers: in subsequent use in another expression the value would be rounded to float&lt;br /&gt;
*for floats: they would be rounded to 14 digits&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Integer-type expressions (unchanged):&lt;br /&gt;
*{{xpsopocc|numf|trunc|trunc(2^63-1024)+trunc1023}}&lt;br /&gt;
&lt;br /&gt;
Explicit integer values in the range of type integer:&lt;br /&gt;
*{{xpsoc|trunc|123|4567890123456789}}&lt;br /&gt;
*{{xpsoc|trunc|1234|567890123456789}}&lt;br /&gt;
*{{xpsoc|trunc|123456|7890123456789}}&lt;br /&gt;
*{{xpsoc|trunc|1234567|890123456789}}&lt;br /&gt;
*{{xpsoc|trunc|12345678|90123456789}}&lt;br /&gt;
*{{xpsoc|trunc|1234567890|123456789}}&lt;br /&gt;
*{{xpsoc|trunc|12345678901|23456789}}&lt;br /&gt;
*{{xpsoc|trunc|123456789012|3456789}}&lt;br /&gt;
*{{xpsoc|trunc|1234567890123|456789}}&lt;br /&gt;
*{{xpsoc|trunc|12345678901234|56789}}&lt;br /&gt;
*{{xpsoc|trunc|123456789012345|6789}}&lt;br /&gt;
*{{xpsoc|trunc|1234567890123456|789}}&lt;br /&gt;
&lt;br /&gt;
*{{xpsopocc|numf|trunc|123|4567890123456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|1234|567890123456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|123456|7890123456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|1234567|890123456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|12345678|90123456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|1234567890|123456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|12345678901|23456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|123456789012|3456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|1234567890123|456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|12345678901234|56789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|123456789012345|6789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|1234567890123456|789}}&lt;br /&gt;
&lt;br /&gt;
*{{xpsopocc|numf|trunc|9e17|1}} (to avoid leading zeros in the second parameter, the first parameter is almost 100 times as large as 9,007,199,254,740,992. However, for every trailing 0 it can be a factor 2 larger then this number; in this case there are 17 trailing zeros; since the factor 100 is less than 2^17 the first parameter is exactly representable as float).&lt;br /&gt;
&lt;br /&gt;
*{{xpsopocc|numf|trunc|-123|-4567890123456789}}&lt;br /&gt;
&lt;br /&gt;
Float expressions with integer values in the range of type integer (the template converts them to type integer):&lt;br /&gt;
*{{xpsoocc|#expr:|trunc|-2^63}}&lt;br /&gt;
&lt;br /&gt;
Float expressions with a non-integer value  (the template applies the mathematical trunc function and returns a result of type integer)::&lt;br /&gt;
*{{xpsopocc|numf|trunc|98.7}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|20/3}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|1e6/3}}&lt;br /&gt;
&lt;br /&gt;
Floats outside the range of type integer (unchanged):&lt;br /&gt;
*{{xpsopocc|numfh|trunc|123.45e20}}&lt;br /&gt;
:Compare the operator trunc:&lt;br /&gt;
:*{{xpsoc|numf|trunc123.45e20}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
A leading zero in the second parameter is ignored:&lt;br /&gt;
*{{xpsopocc|numf|trunc|123456789|0123456789}}&lt;br /&gt;
&lt;br /&gt;
If one of the integers is too large, it is rounded in the conversion to float, making the result inaccurate:&lt;br /&gt;
*{{xpsopocc|numf|trunc|1|234567890123456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|12|34567890123456789}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|12345678901234567|89}}&lt;br /&gt;
*{{xpsopocc|numf|trunc|123456789012345678|9}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Mathematical templates|{{PAGENAME}}]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nijcadmin</name></author>
	</entry>
</feed>