TimeSpan / 2 [英] TimeSpan / 2
问题描述
有没有理由Timespan没有分工的运营商?作为那个
,我认为它应该是一段时间。真的只是一个围绕双变量的
包装?
谢谢,
Michael
IS there a reason Timespan doesn''t have an operator for divide? Being that
it''s an amount of time I would have thought it should. Really it''s just a
wrapper around a double variable?
Thanks,
Michael
推荐答案
迈克尔,
它实际上并不是双变量的包装器。更像是64位
整数。
您可以随时获得Ticks属性的值,除以2,
并从中创建一个新的TimeSpan实例。
-
- Nicholas Paldino [.NET / C#MVP]
- mv*@spam.guard.caspershouse.com
" Michael C" < no **** @ nospam.com写信息
新闻:例如************** @ TK2MSFTNGP04.phx.gbl ...
Michael,
It''s not really a wrapper around a double variable. More like a 64 bit
integer.
You can always get the value of the Ticks property, divide it by two,
and create a new TimeSpan instance from that.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Michael C" <no****@nospam.comwrote in message
news:eg**************@TK2MSFTNGP04.phx.gbl...
有没有一个原因Timespan没有运算符来划分?作为那个
,我认为它应该是一段时间。真的只是一个双变量的
包装?
谢谢,
Michael
IS there a reason Timespan doesn''t have an operator for divide? Being that
it''s an amount of time I would have thought it should. Really it''s just a
wrapper around a double variable?
Thanks,
Michael
" Nicholas Paldino [.NET / C#MVP]" < mv*@spam.guard.caspershouse.com写在
消息新闻:B9 ************************* ********* @ microsof t.com ...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:B9**********************************@microsof t.com...
Michael,
它''不是一个双变量的包装器。更像是64位
整数。
Michael,
It''s not really a wrapper around a double variable. More like a 64 bit
integer.
好点。
Good point.
您可以随时获取Ticks属性的值,除以2 ,
并从中创建一个新的TimeSpan实例。
You can always get the value of the Ticks property, divide it by two,
and create a new TimeSpan instance from that.
是的,在我的情况下,我只得到总秒数并且除以2但我仍然是
好奇为什么有没有分工的操作员。我想看到没有人
提出了一个理由,这意味着MS只是忘记了原因。
Michael
Yes, in my case I just got total seconds and divided by 2 but I''m still
curious as to why there is no operator for divide. I guess seeing no one
came up with a reason that means the reason is MS simply forgot.
Michael
2008年1月24日星期四16:55:16 -0800,Michael C< mi ** @ nospam.comwrote:
On Thu, 24 Jan 2008 16:55:16 -0800, Michael C <mi**@nospam.comwrote:
[.. 。]我想看到没有人
提出了一个理由,这意味着MS只是忘记了原因。
[...] I guess seeing no one
came up with a reason that means the reason is MS simply forgot.
充其量,这意味着没有人阅读你的帖子知道答案。
你不能推断任何东西关于缺乏回应的实际原因。
Pete
At best, it means that no one reading your post knows the answer.
You can''t infer anything about the actual reason from a lack of responses.
Pete
这篇关于TimeSpan / 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!